Skip to content
Prev 10824 / 29559 Next

how to do a principle component analysis with geo-referenced points

Hi list,
I'm applying a PCA to a georeferences set of variables.

As in "A practical Guide to geostatistical mapping" by Hengl, I'm using the
command "prcomp" in R.
To recover the georeference of the principal components (which could have
some NA) it is suggested to use the values available in the returned x data
of the PCA as mask over a grid, which would be the numeric vector of 3103
elements in the example here below (i.e. attr(pc.obj$x, "dimnames")[[1]]).
[...]
$x       : num [1:3103, 1:2] -1.56 -1.56 -1.52 -1.42 -1.56 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:3103] "1" "2" "3" "4" ...
  .. ..$ : chr [1:2] "PC1" "PC2"
[...]

Everything works fine with the meuse dataset, but with my own data I could
not use the mask since the returned x data of the prcomp has weird values,
whose meaning I could not catch from the ?prcomp page:
$ : chr [1:1487] "2314165" "2314215" "2314265" "2314315" ...

The original dataset that fed the PCA has 1493 samples, hence the above
array should have values ranging from 1 to 1493, but it does not, as you can
see.

Any clues about this?
Regards,
Piero