Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201977

Variable number of arguments in r decision tree

$
0
0

Thanks for any help - I'm building a decision tree in R, and the classic example is

iris_ctree <- ctree(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data=iris)

My question is: what if I wanted to enter a variable number of parameters, say instead of pre-ordaining Sepal.Length + Sepal.Width and Petal.Length, it was

Flowervar1, Flowervar2, Flowervar3, etc. What if I don't know the number of independent variables until the program is run, how do I pass that into the formula?


Viewing all articles
Browse latest Browse all 201977

Trending Articles