Dear R Users,

I'm using the randomForest package and would like to generate partial
dependence plots, one after another, for a variety of variables:

m <- randomForest( s, ... )
varnames <- c( "var1", "var2", "var3", "var4" )   # var1..4 are all in
data frame s
for( v in varnames ) {
   partialPlot( x=m, pred.data=s, x.var=v )
}

...but this doesn't work, with partialPlot complaining that it can't
find the variable "v". I think I need to force the evaluation of the
loop variable v so that partialPlot sees the correct variable names,
but am stumped after trying eval and similar functions. Any
suggestions on how to do this? Googling has not turned up anything
very useful.

Thanks,
Ben

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to