Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-14 Thread Ivan Calandra
help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of UriB Sent: Wednesday, July 13, 2011 9:28 AM To: r-help@r-project.org Subject: Re: [R] How to translate string to variable inside a command in an easy way in R Thanks Here is another question I want to have a function

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-13 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of UriB > Sent: Wednesday, July 13, 2011 9:28 AM > To: r-help@r-project.org > Subject: Re: [R] How to translate string to variable inside a command in > an easy

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-13 Thread UriB
Thanks Here is another question I want to have a function that get a string for example y="AMI" and make commands like the following agg<-aggregate(numAMI ~MemberID,right.a,sum) Note that I know that numAMI is part of right.a because another function with the string AMI already generated it. I

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-13 Thread Sarah Goslee
Hi, On Wed, Jul 13, 2011 at 7:03 AM, UriB wrote: > Greg Snow-2 wrote: > "You are suffering from the fact that the longest distance between 2 points > is a shortcut. > > The df$column notation is a shortcut for df[[column]] that has some nice > properties, but the shortcut gets in the way when you

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-13 Thread UriB
Greg Snow-2 wrote: "You are suffering from the fact that the longest distance between 2 points is a shortcut. The df$column notation is a shortcut for df[[column]] that has some nice properties, but the shortcut gets in the way when you want to do something more structured. Try qq1[[z]]==y and a

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-05 Thread Greg Snow
day, July 05, 2011 4:30 AM > To: r-help@r-project.org > Subject: [R] How to translate string to variable inside a command in an > easy way in R > > I want to write a function that get 2 strings y and z and does the > following > R command. > > temp<-qq1[qq1$z=

[R] How to translate string to variable inside a command in an easy way in R

2011-07-05 Thread UriB
I want to write a function that get 2 strings y and z and does the following R command. temp<-qq1[qq1$z==y,] for example if it get y="AMI" and z="PrimaryConditionGroup" It should do the following temp<-qq1[qq1$PrimaryConditionGroup=="AMI",] I could do it by the following function that is ugly and