dat <- matrix(rnorm(500),ncol=10,nrow=50)
K <- Linear(dat)
## Computing the kernel PCA. The plot represents PC1 and PC2:
kpca <- kPCA(K,plot=1:2)
## Computing the contributions to all the PCS:
pcs <- kPCA_imp(dat,secure=FALSE)
## We will draw the arrows for PC1 and PC2.
contributions <- t(pcs$loadings[1:2,])
rownames(contributions) <- 1:10
kPCA_arrows(plot=kpca$plot,contributions=contributions)
Run the code above in your browser using DataLab