calc_bioclim_df: Bioclimatic index calculation

Description Usage Arguments Examples

View source: R/calc_bioclim.R

Description

This function allows you to calculate bioclimatic indices from meteorological timeseries.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
calc_bioclim_df(
  dt,
  index.calc = "winkler",
  frml = NULL,
  agg.func = NULL,
  period = NULL,
  set.zero = NULL,
  na.action = "keep",
  max.gap = 3
)

Arguments

dt

data.frame or data.table with a column of class 'Date' and the columns mentioned in frml

index.calc

string, Name of the index that you want to calculate. See function get_index_params for further details.

frml

A formula object that describes how to calculate the daily index values. The left side of the formula will be used to name the resulting column and the right side to calculate the daily index values.

agg.func

A function that will be used to aggregate the daily values calculated by 'frml' for every year

period

A sequence of numbers that indicates the day of years that should be used to aggregate the index

set.zero

Are values below 0 possible or should they be converted to 0?

na.action

string, what should happen with NAs in the data? If keep, NAs in the data will translate to NAs in the output, if ignore the index is calculated by leaving out the days with NAs and if fill the NAs can be filled up to maxgap by linear interpolation.

id

character string, if supplied this string will be appended as a new column of the resulting dataframe

maxgap

integer, up to how many consecutive missing values should be filled?

Examples

1
2
3
4
5
calc_bioclim_df(dt = dt.agg,
  frml = winkler ~ T_mean - 10,
  agg.func = sum,
  period = 91:304,
  set.zero = T)

sitscholl/rebecka_package documentation built on Aug. 25, 2020, 4:20 a.m.