GEVparameters_map: Create GEV parameter maps for Austria

Description Usage Arguments Value See Also Examples

View source: R/GEVparameters_map.R

Description

this function creates a map of Austria with the chosen GEV parameter

Usage

1
2
3
4
GEVparameters_map(covariables, GEVparam, sd_or_swe,
                  parameter = "shape", plottitle = NULL,
                  save_name = NULL, save_dir = getwd(),
                  printPlot = TRUE)

Arguments

covariables

a named matrix with the covariables. each row corresponds to one location, columns should include at least lon and lat

GEVparam

a matrix with the GEV parameters. each row corresponds to one location, columns are loc, scale and shape

sd_or_swe

a character string; you can either chose snow depth ("sd") or snow water equivalent ("swe")

parameter

a character string; chose which GEV parameter should be plotted; either "loc", "scale" or "shape" (default)

plottitle

a character string defining the title of the plot.
default is plottitle = "sd_or_swe shape/scale/loc parameter", depending on sd_or_swe and parameter. if no plottitle is wanted, use plottitle = ""

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.
default is the working directory

printPlot

logical value; if TRUE (default), the plot is printed

Value

a map of Austria with the chosen GEV parameters

See Also

GEVparameters_from_models

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
# 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"))

# create GEV parameter map
GEVparameters_map(covariables = covariables,
                  GEVparam = sd_GEVparam, sd_or_swe = "sd",
                  parameter = "shape", printPlot = FALSE)

SpatialModelsZAMG documentation built on Nov. 11, 2019, 3 p.m.