Re: [R-sig-Geo] pca on raster layers with NA's

2013-07-24 Thread César Capinha
: Re: [R-sig-Geo] pca on raster layers with NA's César, I think you can do princomp(na.omit(values(s)), cor=TRUE) For large objects, also see the pca example in ?raster::predict Robert ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https

Re: [R-sig-Geo] pca on raster layers with NA's

2013-07-24 Thread César Capinha
: Tuesday, 23 July 2013, 19:53 Subject: Re: [R-sig-Geo] pca on raster layers with NA's Hey Edward, you may find this function useful. https://github.com/environmentalinformatics-marburg/magic/blob/master/eot/src/EotDenoise.R It is designed to 'denoise' raster data (i.e. calculate all possible

[R-sig-Geo] pca on raster layers with NA's

2013-07-23 Thread César Capinha
Dear all, I have a set of 7 overlaying rasters for which I want to perform a principal components analysis and subsequently extract the corresponding maps of the two or three principal components (i.e. the scores). I've been trying to do this for a while, but I keep getting stuck in the

Re: [R-sig-Geo] pca on raster layers with NA's

2013-07-23 Thread Tim Appelhans
Hey Edward, you may find this function useful. https://github.com/environmentalinformatics-marburg/magic/blob/master/eot/src/EotDenoise.R It is designed to 'denoise' raster data (i.e. calculate all possible PCAs and only keep the first k - an integer you specify - PCAs for reconstruction).

Re: [R-sig-Geo] pca on raster layers with NA's

2013-07-23 Thread Robert J. Hijmans
César, I think you can do princomp(na.omit(values(s)), cor=TRUE) For large objects, also see the pca example in ?raster::predict Robert On Tue, Jul 23, 2013 at 10:42 AM, César Capinha nrevist...@yahoo.co.uk wrote: Dear all, I have a set of 7 overlaying rasters for which I want to perform a