PCA using raster datasets in R

后端 未结 6 1645
别那么骄傲
别那么骄傲 2021-01-18 10:48

I have several large rasters that I want to process in a PCA (to produce summary rasters). I have seen several examples whereby people seem to be simply calling prcomp or pr

6条回答
  •  悲哀的现实
    2021-01-18 11:17

    There is rasterPCA function in RStoolbox package http://bleutner.github.io/RStoolbox/rstbx-docu/rasterPCA.html

    For example:

    library('raster')
    library('RStoolbox')
    rasters <- stack(myRasters)
    
    pca1 <- rasterPCA(rasters)
    pca2 <- rasterPCA(rasters, nSamples = 5000)  # sample 5000 random grid cells
    pca3 <- rasterPCA(rasters, norm = FALSE)  # without normalization
    

提交回复
热议问题