Re: [R] Using a variable in the formula

2009-10-26 Thread Rolf Turner
On 27/10/2009, at 4:26 PM, jmark17 wrote: I am sure this question has come up, but searching hasn't given me any results. So I need to enter this line: mx1 <- randomForest(X1 ~ elevation + slope + vegtype, data = moths.train) But the problem is that X1 is currently hard coded. I would in

[R] Using a variable in the formula

2009-10-26 Thread jmark17
I am sure this question has come up, but searching hasn't given me any results. So I need to enter this line: mx1 <- randomForest(X1 ~ elevation + slope + vegtype, data = moths.train) But the problem is that X1 is currently hard coded. I would instead like to be able to put in the value of X1 t