Hi, It seems like the package "mvpart" is quite outdated and not available for the current R release. Since PCA is a very common need I'll suggest finding a replacement for it so that the error will either go away, or it is easier for us to reproduce it.
Best, Jiefei On Tue, Aug 25, 2020 at 1:06 PM Andrew Halford <andrew.half...@gmail.com> wrote: > 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 > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.