data(GNIP_World)
### HOW DID WE CREATE THE OBJECT GNIP_Europe?
## The following example require to have downloaded
## a large elevation raster with the function GetElev()
## and will therefore not run unless you type:
## example(QueryGNIP, run.dontrun=TRUE)
## we first correct the elevations in GNIP_World:
## Not run:
# if(require(raster)) {
# elevationrasterbig <- raster("elevation_raster_gmted2010_30mn.tif")
# GNIP_World$elev <- extract(
# elevationrasterbig,
# cbind(GNIP_World$long, GNIP_World$lat))
# }
# ## End(Not run)
## then we used our function:
GNIP_Europe <- QueryGNIP(
data=GNIP_World,
long.min = -27.34,
long.max = 57.1,
lat.min = 31.62,
lat.max = 68.97)
head(GNIP_Europe)
## uncomment the following to store the file:
# save(GNIP_Europe, file="GNIP_Europe.rda", compress="xz")
### CREATE ISOSCAPE-DATASET FOR WARM MONTHS IN EUROPE
GNIP_Europe_Warm <- QueryGNIP(
data=GNIP_World,
month.min = 5,
month.max = 8,
year.min = 1960,
year.max = 2013,
long.min = -27.34,
long.max = 57.1,
lat.min = 31.62,
lat.max = 68.97)
head(GNIP_Europe_Warm)
### CREATE A DATASET WITH 90% OF OBS
GNIP_World_90pct <- QueryGNIP(
data=GNIP_World,
prop.random=0.9,
random.level = "obs")
lapply(GNIP_World_90pct, head) # show beginnng of both datasets
### CREATE A DATASET WITH HALF THE WEATHER STATIONS
GNIP_World_50pctStations <- QueryGNIP(
data=GNIP_World,
prop.random=0.5,
random.level = "station")
lapply(GNIP_World_50pctStations, head)
Run the code above in your browser using DataLab