Skip to content
Back to formatted view

Raw Message

Message-ID: <CAHmzXO5q5=T=D34rosOmcxQ9ZhjGCgXtznAuQzpX=NW_Qr=gQQ@mail.gmail.com>
Date: 2014-08-27T19:44:12Z
From: Gang Chen
Subject: Issue with formula conversion
In-Reply-To: <67E5AF23-8948-463A-B054-BD04264B7E9D@comcast.net>

Thanks for the help! However, I just need to get

pdCompSymm(~1 + Age)

without a tilde (~) at the beginning.

On Wed, Aug 27, 2014 at 3:34 PM, David Winsemius <dwinsemius at comcast.net> wrote:
>
> On Aug 27, 2014, at 11:19 AM, Gang Chen wrote:
>
>> A random effect formulation for R package nlme is read in as a string
>> of characters from an input file:
>>
>> ranEff <- "pdCompSymm(~1+Age)"
>>
>> I need to convert 'ranEff' to a formula class. However, as shown below:
>>
>>> as.formula(ranEff)
>> ~1 + Age
>>
>> the "pdCompSymm" is lost in the conversion. Any solutions?
>
> as.formula(paste("~",ranEff))
> ~pdCompSymm(~1 + Age)
> --
>
> David Winsemius
> Alameda, CA, USA
>