Hi all, I am fairly new to R and I am trying to run mvpart and create a MRT using explanatory variables and covariables. I've been following the procedures in Numerical Ecoogy with R.
The command (no covariables) which works fine - ABUNDTMRT <- mvpart(abundance ~ .,factors,margin=0.08,cp=0,xv="1se",xval=nrow(abundance),xvmult=100,which=4) where abundance is 4th root transformed fish abundance (103 species x 168 samples), and factors is the relief (high, medium, low profile, sand inundated reef, flat), benthos (coral, sessile inverts, kelp, macroalgae, seagrass, sand), depth (continuous in meters), latitude, and longitude of each sample. To try and incorporate spatial autocorrelation (as a covariate) into this I have been trying the command - ABUNDTMRT <- mvpart(abundance ~ environ + spatial, data.frame,margin=0.08,cp=0,xv="1se",xval=nrow(abundance),xvmult=100,which=4) where abundance is as above, environ is the environmental factors (from above) and spatial is the eigenfunctions from a PCNM analysis. data.frame is the environ and spatial factors as a data.frame. This gives the error - "Error in `[[<-.data.frame`(`*tmp*`, preds, value = c(72L, 72L, 80L, 72L, : replacement has 504 rows, data has 168" As I am new to this, I am not sure if I am entering an incorrect formula when trying to include the covariables, or if this is just something which mvpart cannot do. Thanks. [[alternative HTML version deleted]] ______________________________________________ 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.