filter_dates | R Documentation |
filter_dates
takes a tibble which contains data on a time bound
activity and returns the subset of rows where that activity took place
within a given period. The tibble must contain two columns of Date objects,
which record the start and end dates of an activity. The from and to dates
provided are used to find all rows where some part of the period
of activity took place within the period of filtering. The filtering
process is inclusive: as long as at least one day of activity falls within
the filtering period, the row is returned.
filter_dates(df, start_col, end_col, from_date = NA, to_date = NA)
df |
A tibble containing data on a time bound activity. |
start_col |
The name of the column that contains the start date for the activity. |
end_col |
The name of the column that contains the end date for the activity. |
from_date |
A string or Date representing a date. If a string is used it should specify the date in ISO 8601 date format e.g. '2000-12-31'. The default value is NA, which means no records are excluded on the basis of the from_date. |
to_date |
A string or Date representing a date. If a string is used it should specify the date in ISO 8601 date format e.g. 2000-12-31'. The default value is NA, which means no records are excluded on the basis of the to_date. |
A tibble with the same structure as the input df containing the rows that meet the filtering criteria.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.