Re: [R] character substitution within a variable name

2011-11-24 Thread matric
Great! I got it. You're right, I misinterpreted Duncan's suggestion. Thanks a lot to both of you... Matteo On 24 November 2011 02:47, Rolf Turner-3 [via R] wrote: > On 24/11/11 09:23, matric wrote: >> Thanks Duncan, >> I knew it. But if I use the complete variabl

Re: [R] character substitution within a variable name

2011-11-23 Thread matric
Thanks Duncan, I knew it. But if I use the complete variable name, I'll have far too many arguments for my function On 23 November 2011 20:59, Duncan Murdoch-2 [via R] wrote: > On 23/11/2011 2:29 PM, matric wrote: >> Hi, >> I'd like to create a function that acce

[R] character substitution within a variable name

2011-11-23 Thread matric
Hi, I'd like to create a function that accepts as arguments a string that is to be substituted within a variable name. For instance, suppose I have a data frame df: df<-data.frame(x_narrow=c(rnorm(100,0,1)),x_wide=c(rnorm(100,0,10))) What I have in mind is something like: f <- function(string){