Re: [R] How to pass variable column name into R function

2014-12-19 Thread Jeff Newmiller
HTML mutilated your email. Please post in plain text. Although you are playing with some tricky stuff, you seem to have difficulty understanding the difference between a symbol and the value the symbol represents. Re-reading section 6.1 of the Introduction to R that comes with the software see

[R] How to pass variable column name into R function

2014-12-18 Thread Jeff Johnson
I know this has been explained a few times here in different scenarios, but I am having a hard time digesting this. The following code works fine as long as it's not inside a function (see below). df$season <- as.character(df$season) temp <- model.matrix( ~ season - 1, data=df) df <- cbind(df