New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to be able to sample groups #361
Comments
species <- iris %.%
group_by(Species) %.%
summarise(wt = sum(Sepal.Length)) %.%
sample_n(5, replace = T, weight = wt) %.%
select(-wt)
inner_join(species, iris) |
I wonder why this was closed? Seems like a potentially useful feature
to pick all the data from a random species, e.g. |
I don't think that
The example by @rcorty works just expected
|
+1 |
Edit: A change to For those of you who arrived here via search engine looking for this functionality, the implementation by @MarcusWalz does not sample with replacement when
|
Cluster bootstrapping is a wide use case for this feature. |
@drhagen, in your implementation, do you have any suggestions for how to generate a new unique group id? |
Actually, this is quite easy:
|
The answer above by @drhagen looks like it's out of date. This seems to work now:
|
As well as individuals within groups
The text was updated successfully, but these errors were encountered: