Description Usage Format Source Examples
A raster image of Swiss rain and elevation, and a nearest neighbour matrix corresponding to this raster.
1 |
swissRainR
is a RasterBrick of Swiss elevation and
precipitation, and swissNN
is a matrix of nearest neighbours.
See examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ## Not run:
library('raster')
border = raster::getData('GADM',country='CHE',level=0)
myextent = extent(5 ,12,45,49)
theres=10
rain = raster::getData('worldclim', var='prec',
res=theres,mask=FALSE)#,lon=20,lat=47)
rain = raster::crop(rain,myextent)
plot(rain[['prec3']])
plot(border,add=TRUE)
alt = raster::getData('worldclim', var='alt',res=theres)
alt = raster::crop(alt,extent(rain))
plot(alt)
plot(border,add=TRUE)
bio = raster::getData('worldclim', var='bio',res=theres)
bio = raster::crop(bio,extent(rain))
plot(alt)
plot(border,add=TRUE)
swissRainR = rain
# rain[[c('prec2','prec7')]]
swissRainR = addLayer(swissRainR,alt)
library('geostatsp')
swissNN = NNmat(swissRainR)
save(swissRainR, swissNN,file=
"/home/patrick/workspace/diseasemapping/pkg/gmrf/data/swissRainR.RData",
compress='xz' )
## End(Not run)
data('swissRainR')
plot(swissRainR[['prec7']])
plot(swissRainR[['alt']])
swissNN[1:4,1:5]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.