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 variable name, I'll have far too >> many

Re: [R] character substitution within a variable name

2011-11-23 Thread Rolf Turner
On 24/11/11 09:23, matric wrote: Thanks Duncan, I knew it. But if I use the complete variable name, I'll have far too many arguments for my function Did you understand Duncan's post? He told you that df[,var] would work, whereas df$var doesn't. So he gave you a solution to the probl

Re: [R] character substitution within a variable name

2011-11-23 Thread Duncan Murdoch
On 11-11-23 3:23 PM, matric wrote: Thanks Duncan, I knew it. But if I use the complete variable name, I'll have far too many arguments for my function Maybe a new design is in order. Duncan Murdoch On 23 November 2011 20:59, Duncan Murdoch-2 [via R] wrote: On 23/11/2011 2:29 PM, matr

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 accepts as arguments a string that

Re: [R] character substitution within a variable name

2011-11-23 Thread Duncan Murdoch
On 23/11/2011 2:29 PM, matric wrote: 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 s