I can not figure out the problem in my coding with my scatterplot3D for PCA....what should I do now?

47 views Asked by At
library(scatterplot3d)

fmri.pr <- prcomp(fmri, scale=TRUE)
all.loadings=fmri.pr$rotation
loading.pc1=abs(all.loadings[, 1])    # take absolute value

top300=sort(loading.pc1, decreasing=TRUE)[1:300]

scatterplot3d(x = all.loadings[top300], color= ("red"),  pch=20, xlab="x", ylab="y", zlab="z", main="The most active voxels (Highest 300)")

This is the error I am getting

Error in scatterplot3d(x = all.loadings[top300], color = ("red"), pch = 20, : no data left within (x|y|z)lim

How can I resolve it?

1

There are 1 answers

0
AMAN On
library(scatterplot3d)

#fmri.pr <- prcomp(fmri, scale=TRUE)

all.loadings=fmri.pr$rotation
loading.pc1=abs(all.loadings[,1])    # take absolute value

rank.top300=order(loading.pc1, decreasing=TRUE)[1:300]
scatterplot3d(x = col2coord[rank.top300,], color= ("red"),  pch=20, xlab="x", ylab="y", zlab="z", main="The most extreme voxels (Highest 300)")




I figured the code. It has a dimensional problem and I corrected it...Thanks y'all