Description Usage Arguments Details Value Author(s) Examples
View source: R/filter_mulitple_dates.R
Filter a data.frame for multiple time periods
1 | filter_multiple_dates(x, date_var, date_list, use_names = T)
|
x |
a data.frame |
date_var |
chr string of the name for the datetime column |
date_list |
a list of dates in the format of c(start, end). Dates will be used to filter |
use_names |
logical If |
This function allows the user to filter a single data.frame for multiple time periods.
Returns a data.frame
Julie Padilla
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
df <- data.frame(datetime = seq(from = as.POSIXct('2000-01-01')
, to = as.POSIXct('2000-02-01'), by = 'hour')
, value = rnorm(745))
events <- lapply(list(c('2000-01-02 0:00', '2000-01-02 05:00')
, c('2000-01-04 0:00', '2000-01-04 05:00')), as.POSIXct)
filter_multiple_dates(df, date_var = 'datetime', date_list = events, use_names = F)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.