Skip to content
Prev 25346 / 29559 Next

Problem with operations on large files ("cannotallocate vector of size xx")

Hi,

Blockwise calculation does not make sense with PCA as you will end-up 
with different components in each block.

As I wrote earlier, to calculate the PCA  based on all pixels you should 
calculate the covariance matrix first, which can be done in a memory 
safe way (raster::layerStats) and then feed that into princomp.
see:
https://github.com/bleutner/RStoolbox/blob/master/R/rasterPCA.R

cheers,
Benjamin
On 03.02.2017 15:10, Maurizio Marchi wrote: