-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of Tal Galili
Sent: Wednesday, January 26, 2011 10:07 AM
To: Henrique Dallazuanna
Cc: r-help at r-project.org
Subject: Re: [R] Extracting the terms from an rpart object
Thanks Henrique, exactly what I was looking for.
----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili at gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il
(Hebrew) |
www.r-statistics.com (English)
--------------------------------------------------------------
--------------------------------
On Wed, Jan 26, 2011 at 7:40 PM, Henrique Dallazuanna
<wwwhsd at gmail.com>wrote:
Try this:
all.vars(terms(fit1))
all.vars(terms(fit2))
On Wed, Jan 26, 2011 at 3:33 PM, Tal Galili
<tal.galili at gmail.com> wrote:
Hello all,
I wish to extract the terms from an rpart object.
Specifically, I would like to be able to know what is the response
variable
(so I could do some manipulation on it).
But in general, such a method for rpart will also need to
case
(see fit2)
Here are two simple examples:
fit1 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
fit1$call
fit2 <- rpart(Kyphosis ~ ., data=kyphosis)
fit2$call
Is there anything "prettier" then using string manipulation?
Thanks.
----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili at gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) |
www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
--------------------------------------------------------------
--------------------------------
[[alternative HTML version deleted]]