I am trying to perform PCA with a microbiome data and visualize it with my outcome. After opening the data in wide format with counts from each bacteria as a column, I can see that they are all in numeric format. However, when I try to run PCA, it gives me a strange error, which I could not find easily through a google search. Below is my code:
`phylum_s1 <- read_dta(“phylum_wide_s1.dta”)
PCA for SHIP-1
pca1<- pca(phylum_s1[,20:37],ncomp=2, center=FALSE, scale=FALSE)`
After the final code, I get the error “Error in ph.new/drop(sqrt(crossprod(ph.new))) : non-conformable arrays”. If someone has a solution, it would be really helpful for me.