PCA using raster datasets in R

后端 未结 6 1643
别那么骄傲
别那么骄傲 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:09

    Yet another option would be to extract the vales from the raster-stack, i.e.:

    rasters <- stack(my_rasters)
    values <- getValues(rasters)
    pca <- prcomp(values, scale = TRUE)
    

提交回复
热议问题