[R] How make a x,y dataset from a formula based entry
jcbouette at gmail.com
Thu Sep 22 22:14:05 CEST 2011
You can check ?model.frame.
I do not know however to extract only the right-hand of left-hand part
of a formula.
2011/9/22 trekvana <trekvana at aol.com>:
> Hello all,
> So I am using the (formula entry) method for randomForests:
> randomForest(y~x1+x2+...+x39+x40,data=xxx,...) but the issue is that some of
> the items in that package dont take a formula entry - you have to explicitly
> state the y and x vector:
> Now my question is whether there is a function/way to tell R to take a
> formula and make the two corresponding datasets [x,y] (that way I dont have
> to create the x dataset manually with all 40 variables I have).
> There must be a more elegant way to do this than
> View this message in context: http://r.789695.n4.nabble.com/How-make-a-x-y-dataset-from-a-formula-based-entry-tp3834477p3834477.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help