get_years_from_weatherDF: Extract years to weather data.frame

View source: R/sw_dbW_WeatherDatabase.R

get_years_from_weatherDFR Documentation

Extract years to weather data.frame

Description

Extract years to weather data.frame

Usage

get_years_from_weatherDF(weatherDF, years, weatherDF_dataColumns)

Arguments

weatherDF

A data.frame. Daily weather data where rows represent days and columns represent the weather variables (see weatherDF_dataColumns).

years

A numeric or integer vector or NULL. Vector of year data where length is equal to either the number of years in the weather data.frame or the number of rows in the data.frame.

weatherDF_dataColumns

A vector of character strings. The column names of weatherDF in the correct order for SOILWAT2 including calendar year year (optional) and day of year DOY, see weather_dataColumns().

Value

A named list of length 2.

  • years a vector of unique year values.

  • year_ts a vector of time series values for each row/day of the data.frame.

Notes

The first element of weatherDF_dataColumns (only the first is used) must contain the column name for day of year.


Burke-Lauenroth-Lab/Rsoilwat documentation built on Dec. 9, 2023, 12:41 a.m.