Re: [R] Symbolic references - passing variable names into functions

2009-08-12 Thread Gabor Grothendieck
Returning the changed value as in Erik's answer is probably the most common and R-like solution but here are two others. The assign/get approach is perhaps the closest to what you are asking for. # replacement function approach # replacement function - rhs is formula whose response is assigned t

Re: [R] Symbolic references - passing variable names into functions

2009-08-12 Thread Erik Iverson
I think ONE answer to what you actually want to do might be f <- function(dataf, col1 = "column1", col2 = "column2") { dataf[[col1]] <- dataf[[col2]] # just as an example dataf } -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.o