[R] as.formula doesn't want to take a phrase
Dimitri Liakhovitski
dimitri.liakhovitski at gmail.com
Mon Apr 18 21:54:43 CEST 2011
Makes sense, Marc - thanks a lot!
On Mon, Apr 18, 2011 at 3:54 PM, Marc Schwartz <marc_schwartz at me.com> wrote:
> On Apr 18, 2011, at 2:44 PM, Dimitri Liakhovitski wrote:
>
>> Hello!
>>
>> I am trying to create a formula object using as.formula. But it's not working:
>>
>> examplephraze<-"for.my.example"
>> myformula<-as.formula(paste(examplephraze,"~group, sum, data=mydata",sep=""))
>>
>> What's the problem?
>> Thanks a lot!
>
>
> The actual 'formula' part consists *only* of the actual model specification formula (LHS ~ RHS), not the additional arguments to a model function or other function that takes a formula as an argument (eg. boxplot()).
>
> Thus:
>
> myformula <- as.formula(paste(examplephraze,"~group"))
>
>> myformula
> for.my.example ~ group
>
>
> HTH,
>
> Marc Schwartz
>
>
--
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com
More information about the R-help
mailing list