[R] incompatible dimensions error

Andrew Halford @ndrew@h@||ord @end|ng |rom gm@||@com
Tue Aug 25 07:05:13 CEST 2020


Hi Listers

Using mvpart to run a MV regression tree with PCA= TRUE to get a PCA
plotted with sites coloured according to the tree output.

Unfortunately it wont produce the PCA, instead giving the error message..

Error in cor(xall, xx[order(tree$where), ]) : incompatible dimensions.

However, when I run a PCA on the data using the rda command I have no
problems producing a PCA.

data is attached as a text file

my code is thus...
fish05.hel <- decostand(fish05,"hellinger")
fish05.mrt <-
mvpart(data.matrix(fish05.hel)~.,env,margin=0.08,cp=0,rsq=TRUE,xv="pick",xval=nrow(fish05),xvmult=100,which=4,pca=TRUE)

The tree is produced no problem but it wont produce a PCA.

I am just keen to understand what this error means as I dont see anything
unusual about the dataset used, notwithstanding the data is rather messy.

Andy





-- 
Andrew Halford Ph.D
Senior Coastal Fisheries Scientist
Pacific Community | Communauté du Pacifique CPS – B.P. D5 | 98848 Noumea,
New Caledonia | Nouméa, Nouvelle-Calédonie

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fish05.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200825/5a37d362/attachment.txt>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: env.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200825/5a37d362/attachment-0001.txt>


More information about the R-help mailing list