Helper function: select timeperiod

select_timeperiod(
  df,
  date_start,
  date_end = as.Date(date_start) + 365.25,
  col_date = "date"
)

Arguments

df

data frame with date (defined in parameter "col_date)

date_start

start date of selection

date_end

end date of selection. If no value is given 365.25 days after "date_start" will be used (default: as.Date(date_start) + 365.25)

col_date

column for dates (default: "date")

Value

data frame with selected dates

Examples

path <- kwb.heatsine::extdata_file("temperature_groundwater_Txxxx3.csv") gw_data <- kwb.heatsine::load_temperature_from_csv(path) gw_data_selected <- kwb.heatsine::select_timeperiod(gw_data, date_start = "2015-12-28", date_end = "2016-12-26") gw_data_selected
#> # A tibble: 360 x 2 #> date value #> <date> <dbl> #> 1 2015-12-28 11.3 #> 2 2015-12-29 11.2 #> 3 2015-12-30 11.1 #> 4 2015-12-31 11.1 #> 5 2016-01-01 11 #> 6 2016-01-02 10.9 #> 7 2016-01-03 10.8 #> 8 2016-01-04 10.8 #> 9 2016-01-05 10.7 #> 10 2016-01-06 10.7 #> # … with 350 more rows