Description Usage Arguments S3 generic Examples
Inflate a data frame
1 |
data(data.frame) |
A data frame to inflate |
var(string) |
Column name specifying column to inflate over.
The column should be of class |
domain(Date) |
A vector of two dates (or two strings that can be
coerced to dates). Used to specifiy the range to inflate over.
The first date should specify the lower bound of the date range; the second
date should specify the upper bound of the date range. If |
This function has methods for:
data.frame
grouped_df
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(dplyr)
sales_data <- data_frame(
date = as.Date(c("2014-01-01", "2014-01-03")),
sales = c(10, 13)
)
inflate_(sales_data, "date")
inflate_(sales_data, "date", domain = c("2013-12-31", "2014-01-04"))
grp_sales_data <- data_frame(
group = c("a", "a", "b", "b"),
date = as.Date(c("2014-01-01", "2014-01-03", "2014-01-01", "2014-01-03")),
sales = c(10, 13, 20, 30)
)
grp_sales_data %>%
group_by(group) %>%
inflate_("date")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.