Skip to content

slice_sample does not restrict sampling to n() within a group when replace=TRUE. #7781

@tlyons253

Description

@tlyons253

I've been playing around with slice_sample on grouped data frames for bootstrapping. The documentation states that if you provide a prop>1 or n> # of rows within a group, it will only sample the number of rows within a group. If you have replace=TRUE, that's not respected and you get as many samples per group as you request. I thought it was going to be a slick way to handle resampling from groups with different numbers of observations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions