Description Usage Arguments Value See Also Examples
View source: R/returnlevel_map.R
this function creates a map of Austria with return levels
1 2 3 |
covariables |
a named matrix with the covariables. each row corresponds to one location, columns should include at least lon and lat |
rl |
a vector with the return level for every location |
q |
the return period – must be a number greater than 1 |
sd_or_swe |
a character string; you can either chose snow depth ( |
plottitle |
a character string defining the title of the plot. |
save_name |
a character string defining the saving name of the map. |
save_dir |
a character string defining the directory for the map to be saved. |
printPlot |
logical value; if |
a map of Austria with the return levels
returnlevels
, returnlevel_plot
, cond_returnlevel_map
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 44 45 | # get covariables
lon = get(data(lon.at))
lon = as.vector(t(lon))
lat = get(data(lat.at))
lat = as.vector(t(lat))
alt = get(data(alt.at))
alt = as.vector(t(alt))
x = get(data(sample_grid_data))
mdday = x$mdday
sd_mmax = x$mmsd
swe_mmax = x$mmswe
# take only locations of the (Austrian) domain
lon = lon[which(!is.na(mdday))]
lat = lat[which(!is.na(mdday))]
alt = alt[which(!is.na(mdday))]
mdday = mdday[which(!is.na(mdday))]
sd_mmax = sd_mmax[which(!is.na(sd_mmax))]
swe_mmax = swe_mmax[which(!is.na(swe_mmax))]
# define matrix 'covariables'
covariables = cbind("lon" = lon, "lat" = lat, "alt" = alt,
"mdday" = mdday, "sd_mmax" = sd_mmax,
"swe_mmax" = swe_mmax)
# load function output from GEVparameters_from_models
sd_GEVparam = get(data("sd_GEVparam"))
swe_GEVparam = get(data("swe_GEVparam"))
# calculate returnlevels
q = 100
sd_rl = returnlevels(GEVparam = sd_GEVparam, q = q)
swe_rl = returnlevels(GEVparam = swe_GEVparam, q = q)
# create return level maps
returnlevel_map(covariables = covariables,
rl = sd_rl, q = q,
sd_or_swe = "sd",
printPlot = FALSE)
returnlevel_map(covariables = covariables,
rl = swe_rl, q = q,
sd_or_swe = "swe",
printPlot = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.