Description Usage Arguments Value Note Author(s) See Also Examples
Derives Spatial Predictive Components for a given set of covariates. It wraps the stats::prcomp
method and predicts a list principal components for an object of type "SpatialPixelsDataFrame"
.
1 2 3 4 5 6 |
obj |
object of class |
formulaString |
object of class |
scale. |
object of class |
silent |
object of class |
... |
additional arguments that can be passed to |
spc
returns an object of type "SpatialComponents"
. This is a list of grids with generic names PC1
,...,PCp
, where p
is the total number of input grids.
This method assumes that the input covariates are cross-correlated and hence their overlap can be reduced. The input variables are scaled by default and the missing values will be replaced with 0 values to reduce loss of data due to missing pixels. This operation can be time consuming for large grids.
Tomislav Hengl
stats::prcomp
, SpatialComponents-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # load data:
library(plotKML)
library(sp)
pal = rev(rainbow(65)[1:48])
data(eberg_grid)
gridded(eberg_grid) <- ~x+y
proj4string(eberg_grid) <- CRS("+init=epsg:31467")
formulaString <- ~ PRMGEO6+DEMSRT6+TWISRT6+TIRAST6
eberg_spc <- spc(eberg_grid, formulaString)
names(eberg_spc@predicted) # 11 components on the end;
## Not run: # plot maps:
rd = range(eberg_spc@predicted@data[,1], na.rm=TRUE)
sq = seq(rd[1], rd[2], length.out=48)
spplot(eberg_spc@predicted[1:4], at=sq, col.regions=pal)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.