Description Usage Arguments Value
The dataframe argument must contain a column with valid dates. The timeframe argument specifies a timeframe xts-style daily. For example, "2011-01-01/2011-12-31" is valid whereas "2011" is not.
1 2 |
df |
The dataframe to subset by dates |
timeframe |
A character string specifying the timeframe as two full dates separated by a slash. For example, "2010-10-01/2010-10-22". |
datecol |
The column name where the dates are found in the dataframe. Although these may be of class char, they will be converted to class Date before subsetting is applied. |
keep_NAs |
Logical flag specifying whether to apply complete.cases to the dataframe to eliminate rows with NAs. |
bounds_rm |
Logical vector of length 2. Specified whether to exclude the rows at the boundary dates specified in timeframe. The first element specifies whether to exclude the start dates while the second element specified whether to exclude the end dates. Default is c(FALSE, FALSE), so both the beginning dates and end dates are included. |
Returns a subsetted dataframe containing rows with dates within the timeframe supplied. Also, complete.cases is applied to eliminate rows with NAs if keep_NAs = FALSE (default).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.