collect.resampled_df: Force virtual groups to become explicit rows

Description Usage Arguments Examples

View source: R/collect.R

Description

When collect() is used on a resampled_df, the virtual bootstrap groups are made explicit.

Usage

1
2
## S3 method for class 'resampled_df'
collect(x, ..., id = NULL, original_id = NULL)

Arguments

x

A resampled_df.

...

Not used.

id

Optional. A single character that specifies a name for a column containing a sequence from 1:n for each bootstrap group.

original_id

Optional. A single character that specifies a name for a column containing the original position of the bootstrapped row.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(dplyr)

# virtual groups become real rows
collect(bootstrapify(iris, 5))

# add on the id column for an identifier per bootstrap
collect(bootstrapify(iris, 5), id = ".id")

# add on the original_id column to know which row this bootstrapped row
# originally came from
collect(bootstrapify(iris, 5), original_id = ".original_id")

DavisVaughan/strapgod documentation built on Jan. 25, 2020, 8:01 a.m.