# NOT RUN {
library(raster)
elev <- raster::getData('alt', country='SWZ', mask=TRUE)
tmax <- raster::getData('worldclim', var='tmax', res=10, lon=8.25, lat=46.8)
tmax <- crop(tmax[[1]], extent(elev))
tmax.ds <- raster.downscale(elev, tmax, scatter=TRUE)
par(mfrow=c(2,2))
plot(tmax, main="Temp max")
plot(elev, main="elevation")
plot(tmax.ds$downscale, main="Downscaled Temp max")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab