hanks for the help.
>
> Regards
>
>
> John Seers
>
>
> ---
> -Original Message-
> From: Peter Dalgaard [mailto:[EMAIL PROTECTED]
> Sent: 01 February 2008 10:04
> To: [EMAIL PROTECTED]
>
> Cc: john seers (IFR); [EMAIL PROTECTED]
> Subject: Re: [R] Buil
Thanks for the help.
Regards
John Seers
---
-Original Message-
From: Peter Dalgaard [mailto:[EMAIL PROTECTED]
Sent: 01 February 2008 10:04
To: [EMAIL PROTECTED]
Cc: john seers (IFR); [EMAIL PROTECTED]
Subject: Re: [R] Building a formula using paste
[EMAIL PROTECTED] wrote
February 2008 09:57
To: [EMAIL PROTECTED]; john seers (IFR); [EMAIL PROTECTED]
Subject: RE: [R] Building a formula using paste
Please disregard my previous reply. Now that I have read your question,
all becomes clear.
To do what you want to do is a bit tricky. Here is one way
f1 <- as.name("
[EMAIL PROTECTED] wrote:
> use as.formula() rather than just formula().
>
>
>
Hm?
That doesn't seem to cut it for me:
> f <- as.formula(y~x)
> lm(f)
Call:
lm(formula = f)
Coefficients:
(Intercept)x
0.06437 -0.09714
> summary(lm(f))
Call:
lm(formula = f)
Residuals:
lto:[EMAIL PROTECTED]
http://www.cmis.csiro.au/bill.venables/
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Venables, Bill (CMIS, Cleveland)
Sent: Friday, 1 February 2008 7:45 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [R] Building a form
7 3286 7700
mailto:[EMAIL PROTECTED]
http://www.cmis.csiro.au/bill.venables/
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of john seers (IFR)
Sent: Friday, 1 February 2008 7:31 PM
To: [EMAIL PROTECTED]
Subject: [R] Building a formula using paste
Hi All
Hi All
I have looked but cannot find an answer to this.
I want to build a formula dynamically (in a function), using for example
paste, and using it in a model:
fr<-"F1"
f1<-formula(paste(fr, "~ SensoryTerm"))
m1<-aov(f1, data=vdata)
So this is the equivalent of
7 matches
Mail list logo