[R] how to save many trees within a loop?

Angel Marley angel_nauti at yahoo.com
Tue May 20 14:39:35 CEST 2008


Hi,
I would like to save many trees created in a loop as
different ones. I can plot them, but I can not get the
whole tree properties saved. I paste the script below
Also, How can I perform multivariate trees?, that is
predicting a vector o values, not a simple scalar
observation.
Thanks in advance
Angel

for (i in 1:7){#loop para hacer arb
arb=arb[i]#contador
arb=tree(GF[,i]~Temp+Area+ISS+Zmix+Kd+Alk+DIN+SRP+RSi+CLA+Chloa,
data=GF)#
plot.tree(arb); tit=colnames(GF[i]);title(tit); 
text(arb,digits =2);#dig significativos



More information about the R-help mailing list