![]() ![]() Select(where(is.numeric)) %>% # retain only numeric columns We do so by using the argument scale = TRUE in prcomp(). Second, we normally want to scale the data values to unit variance before PCA. ![]() This is straightforward using the where(is.numeric) tidyselect construct. First, the prcomp() function can only deal with numeric columns, so we need to remove all non-numeric columns from the data. We start by running the PCA and storing the result in a variable pca_fit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |