aggregate_interpolate_points: Interpolate and temporal aggregate DWD values

Description Usage Arguments Value Author(s) Examples

View source: R/aggregate_interpolate_points.R

Description

This functions interpolates points based on a dataframe containing coordinates, an aim variable, an aim dataset and a parameter such as a date, by which the interpolations are divided

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
aggregate_interpolate_points(
  dataframe,
  coords,
  epsg,
  DateTime,
  infection,
  incubation,
  aim_variable,
  outputfile,
  trans_epsg = FALSE,
  co_variables = FALSE,
  procedure = c("ked", "ok", "idw"),
  progressbar = TRUE
)

Arguments

dataframe

dataframe containing the aim variable and if "ked" should be applied the covariables

coords

vector containing names of the columns containing x and y coordinate values

epsg

number of the EPSG code of the "coords" information

DateTime

name of the DateTime column

infection

duration of the assumed infection

incubation

duration of the assumed incubation

aim_variable

Character string with the name of the aim variable

outputfile

SpatialPointsDataframe, SpatialGridDataFrame or raster which should be filled with predictions; requires covariables for "ked"

trans_epsg

default = FALSE, number of the EPSG code the "coords" information should be transformed to

co_variables

default = FALSE, vector of covariables if needed

procedure

default = c("ked","ok","idw"); vector containing the interpolation technic to be used; the first method is used and if this does not work out, the second, and so on

progressbar

default = TRUE; should a progressbar be generated?

Value

a dataframe or a SpatialPointsDataFrame containing information about DWD locations in Germany

Author(s)

Wolfgang Hamer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Download example data
shdat <- download_statewide_hourly_station_data(state = "Schleswig-Holstein", coord = TRUE)

shdat2 <- shdat %>%
    filter(DateTime < sort(unique(shdat$DateTime))[50])

example <- aggregate_interpolate_points(dataframe = shdat2,
                                       coords = c("lon","lat"),
                                       DateTime = "DateTime",
                                       infection=2,
                                       incubation=8,
                                       aim_variable ="Temperature",
                                       outputfile=c(1000,1000),
                                       co_variables = FALSE,
                                       procedure = c("ked","ok","idw"),
                                       epsg = 4326,
                                       trans_epsg = 25832)
plot(example[[1]])

whamer/papros documentation built on Feb. 6, 2021, 8:54 a.m.