Description Usage Arguments Value Examples
Keep rows of data where start_col and (optional) end_col lie within an inclusive interval defined by study_start and study_end
1 | study_subset(x, start_col, end_col = NULL, study_start, study_end)
|
x |
a dataframe or tibble with start and end columns |
start_col |
the name of the start column in x |
end_col |
the name of the end column in x. Default = NULL |
study_start |
the first part of the interval you want to subset by |
study_end |
the end of the interval to subset by |
a filtered dataframe or tibble
1 2 3 4 5 6 7 8 9 10 | df <- data.frame(cam = c(1,1,2,2),
datetime = as.POSIXct(c("2016-01-02 12:00:00",
"2016-01-03 13:12:00",
"2016-01-02 14:00:00",
"2016-01-03 16:53:42"),
tz = "GMT"),
a = c(850, 850, 1100, 1100),
count = c(1, 0, 0, 2))
d <- as.POSIXct(c("2016-01-01 00:00:00", "2016-01-02 23:59:59"), tz = "GMT")
study_subset(df, "datetime", NULL, d[1], d[2])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.