new_grouped_df | R Documentation |
new_grouped_df()
and new_rowwise_df()
are constructors designed to be high-performance so only
check types, not values. This means it is the caller's responsibility
to create valid values, and hence this is for expert use only.
validate_grouped_df()
and validate_rowwise_df()
validate the attributes
of a grouped_df
or a rowwise_df
.
new_grouped_df(x, groups, ..., class = character())
validate_grouped_df(x, check_bounds = FALSE)
new_rowwise_df(data, group_data = NULL, ..., class = character())
validate_rowwise_df(x)
x |
A data frame |
groups |
The grouped structure, |
... |
additional attributes |
class |
additional class, will be prepended to canonical classes. |
check_bounds |
whether to check all indices for out of bounds problems in |
# 5 bootstrap samples
tbl <- new_grouped_df(
tibble(x = rnorm(10)),
groups = tibble(".rows" := replicate(5, sample(1:10, replace = TRUE), simplify = FALSE))
)
# mean of each bootstrap sample
summarise(tbl, x = mean(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.