Hello everyone,
I wanted to ask on how do you display the row column for broom::tidy(PCA, matrix="loadings")
output?
broom::tidy(PCA)
's first column showed a column I am expecting to show in the first column of broom::tidy(PCA, matrix = "loadings")
.
library(tidyverse)
data("USArrests")
PCA <- prcomp(USArrests, scale. = T)
broom::tidy(PCA) %>% #from this matrix.
slice(1:10) %>% #pick the first 10 vector
mutate(value = pull(slice(broom::tidy(PCA, matrix = "loadings")[,"value"], 1:10))) #and then use it to replace this matrix's first column
Is this possible?
Thank you very much.