Thanks, Rich.
I thought of that, too, but it violates the spirit of my restraints (to
avoid character strings), which I unfortunately did not clearly articulate.
So my apologies for that failure. My concern is that with more complex
model formula, using as.formula, etc. to parse/convert character
variables. Rejoin the
dependent variable to the data frame. Pass that to reformulate.
Tim
-Original Message-
From: Rui Barradas
Sent: Sunday, March 30, 2025 4:05 AM
To: Ebert,Timothy Aaron ; Bert Gunter ;
Richard M. Heiberger ; R-help
Subject: Re: [R] [External] Creating model formulas progr
where R can assume that the first variable is the
dependent variable and all others are independent variables, I see no way
of processing that within the current modeling system without generating a
formula (a string) that gets parsed.
-Original Message-
From: R-help On Behalf Of Rich
gful
way. The best I can do is to try to hide the string from you.
Tim
-Original Message-
From: R-help On Behalf Of Bert Gunter
Sent: Saturday, March 29, 2025 6:40 PM
To: Richard M. Heiberger ; R-help
Subject: Re: [R] [External] Creating model formulas programmatically
[External Emai
eling system without generating a
> formula (a string) that gets parsed.
>
> -Original Message-
> From: R-help On Behalf Of Richard M.
> Heiberger
> Sent: Saturday, March 29, 2025 8:47 PM
> To: Bert Gunter
> Cc: R-help
> Subject: Re: [R] [External] Creating model
om: R-help On Behalf Of Richard M. Heiberger
Sent: Saturday, March 29, 2025 8:47 PM
To: Bert Gunter
Cc: R-help
Subject: Re: [R] [External] Creating model formulas programmatically
[External Email]
my take of the assignment was to avoid 'parse' specifically.
we start with a chara
my take of the assignment was to avoid 'parse' specifically.
we start with a character vector, so avoiding characters is not possible. i was
dealing with the fortune "if parse is the answer, you have the wrong question"
Sent from my iPhone
On Mar 29, 2025, at 15:39, Bert Gunter wrote:
Thanks
string from you.
Tim
-Original Message-
From: R-help On Behalf Of Bert Gunter
Sent: Saturday, March 29, 2025 6:40 PM
To: Richard M. Heiberger ; R-help
Subject: Re: [R] [External] Creating model formulas programmatically
[External Email]
Thanks, Rich.
I thought of that, too, but it vio
> somenames <- c("Heigh", "Ho", "Silver", "Away")
> as.formula(paste("~(",paste(somenames, collapse="+"),")^2"))
~(Heigh + Ho + Silver + Away)^2
>
> On Mar 29, 2025, at 14:30, Bert Gunter wrote:
>
> somenames <- c("Heigh", "Ho", "Silver", "Away")
__
9 matches
Mail list logo