get_data_from_Robj: Extract the snow data from a saved 'robj' file

Description Usage Arguments Details Value See Also Examples

View source: R/get_data_from_Robj.R

Description

this function extracts the snow data from a saved robj file which consists of a list of stations like described in the Details section

Usage

1
get_data_from_Robj(dataname, measurements_barrier = 10)

Arguments

dataname

the dataname of the saved robj file as a character string

measurements_barrier

how many measurements does each station has to have at least. those stations are used later on in the optimization (see functions optimizer_..._model).
default is measurements_barrier = 10

Details

the saved robj file should include a list of stations with dataframes meta and data. stations are ordered via station number.

meta should include stnr, lon, lat and alt

data should include year, sd, swe, date.sd and date.swe

see also the sample snow data from 36 examplary stations distributed over Austria:
sample_snow_data

Value

a list with

snow_data

the data of the saved file (as a list).
all stations with less than measurements_barrier measurements have been deleted

sd_max_data

a matrix with the yearly maxima of snow depth (sd). each row corresponds to one station, columns are the corresponding years. matrix might contain NA's

swe_max_data

a matrix with the yearly maxima of snow water equivalent (swe). each row corresponds to one station, columns are the corresponding years. matrix might contain NA's

covariables

a matrix with the covariables for each station. each row corresponds to one station, columns are lon (longitude), lat (latitude), alt (altitude), mdday (mean of the time difference in days of sd and swe maxima), sd_mmax (mean maxima of sd over all years) and swe_mmax (mean maxima of swe over all years)

See Also

model_selection, optimizer_smooth_model, optimizer_biv_hr_model

Examples

1
2
3
4
5
6
7
# load sample_snow_data and save it to working directory
data(sample_snow_data)
save(sample_snow_data, file = "sample_snow_data.robj")

get_data =
  get_data_from_Robj(dataname = "sample_snow_data.robj",
                     measurements_barrier = 3)

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