View source: R/weather_extract.R
weather_extract | R Documentation |
Extract column(s) from a tibble/data frame of daily weather data between two specified dates. Either specify the start and end dates or specify one of these dates and also the number of days after or before, respectively.
weather_extract(
data,
var,
datevar = NULL,
ndays = 5,
startdate = NULL,
enddate = NULL,
monitor = FALSE,
return.dates = TRUE,
warn.consecutive = TRUE
)
data |
Tibble or dataframe of daily weather data |
var |
Variable(s) to be extracted (Default: radn). Several columns
may be specified using column names |
datevar |
Date variable specifying day (Default: date_met) |
ndays |
Number of days after/before the start or end date, respectively. Ignored of both the start and end dates are specified (Default: 5) |
startdate |
Start date of data to be extracted |
enddate |
Final date of data to be extracted |
monitor |
For debugging. Prints data and dates. (Default: FALSE) |
return.dates |
A logical indicating whether to return the date column (Default: TRUE) |
warn.consecutive |
A logical indicating whether to check that dates are consecutive, that none are missing and provide a warning if not (Default:TRUE) |
A tibble (data frame) of extracted weather data
between
filter
,
cumulative
, daily_mean
,
growing_degree_days
, and stress_days_over
library(lubridate)
boonah |>
weather_extract(rain, date = date_met, startdate = ymd("2019-08-16"),
enddate = ymd("2019-08-21"))
boonah |>
weather_extract(rain, startdate = ymd("2019-08-16"),
enddate = ymd("2019-08-21"))
boonah |>
weather_extract(maxt, date = date_met, startdate = ymd("2019-08-16"),
ndays = 3, return.dates = FALSE)
boonah |>
weather_extract(mint, enddate = ymd("2019-08-16"), ndays = 1)
## extract multiple columns
boonah |>
weather_extract(c(year, day, mint, maxt), enddate = ymd("2019-08-16"),
ndays = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.