Hello community, I need help on how I can perform PCA on stacked raster (multiple bands/ layers) in R. Does any body have an idea or script? Thanks? John [[alternative HTML version deleted]]
Gustavo Bediaga
2014-Oct-30 17:14 UTC
[R] PCA on stacked raster (multiple bands/ layers) in R
Hi, You have to transform it to a Data Frame. Try: files <- stack(rasterlist) filesdf<-as.data.frame(files) pca <- princomp(formula = ~., data = filesdf, cor = TRUE, na.action=na.exclude) hope it helps Gustavo Em quinta-feira, 30 de outubro de 2014 14h38min56s UTC-2, John Wasige escreveu:> > Hello community, I need help on how I can perform PCA on stacked raster > (multiple bands/ layers) in R. Does any body have an idea or script? > Thanks? > John > > [[alternative HTML version deleted]] > > ______________________________________________ > R-h... at r-project.org <javascript:> mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >