User Tools

Site Tools


en:pca_examples_rscript
# Example 4
chem <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/chemistry.txt', row.names = 1)
chem <- chem [, -15] # removes slope, which is not chemical variable
chem.var <- apply (chem, 2, var)
sort (chem.var, decreasing = T)
PCA.nst <- rda (chem, scale = FALSE)
head (summary (PCA.nst))
 
scores (PCA.nst, display = 'species', scaling = 0)
 
stand.chem <- scale (chem)
stand.chem.var <- apply (stand.chem, 2, var)
sum (stand.chem.var)
en/pca_examples_rscript.txt · Last modified: 2018/04/15 11:20 by David Zelený