Variable treatment for R data frames