Factor Analysis using R and grass
Hi, Alternatively, if you must use all of the pixels in a massive grid, you can do PCA in GRASS with the i.pca command. Note that you must take care of standardization if you are using variables with different units / scales. Cheers, Dylan
On Wednesday 25 March 2009, Tomislav Hengl wrote:
Hi Brian, The PCA you can also run without GRASS e.g.:
gridmaps <- readGDAL("NED1.asc")
names(gridmaps)[1] <- "DEM"
proj4string(gridmaps) <- CRS("+init=epsg:32618")
gridmaps$twi <- readGDAL("twi.asc")$band1
gridmaps$achan <- readGDAL("achan.asc")$band1
gridmaps$insolat <- readGDAL("insolat.asc")$band1
pc.dem <- prcomp(~DEM+twi+achan+insolat, scale=TRUE, gridmaps at data)
biplot(pc.dem, arrow.len=0.1, xlabs=rep(".", length(pc.dem$x[,1])),
main="PCA biplot")
If you have missing pixels or if you use a max, then you will need to select the generated components before you can reproduce the maps. See also: http://spatial-analyst.net/wiki/index.php?title=Analysis_of_DEMs_in_R%2BILW IS/SAGA HTH Tom Hengl http://spatial-analyst.net -----Original Message----- From: r-sig-geo-bounces at stat.math.ethz.ch [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Brian Cooper Sent: Wednesday, March 25, 2009 2:27 PM To: r-sig-geo at stat.math.ethz.ch Subject: [R-sig-Geo] Factor Analysis using R and grass I am new to both R and Grass. I need to duplicate the Principal Component Analysis approach used in SPSS with GRASS and R. Is this possible? brian Cooper [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo _______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Dylan Beaudette Soil Resource Laboratory http://casoilresource.lawr.ucdavis.edu/ University of California at Davis 530.754.7341