Skip to content
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

add prop argument to rep_slice_sample #362

Closed
wants to merge 4 commits into from

Conversation

simonpcouch
Copy link
Collaborator

This PR adds a prop argument to rep_slice_sample() and rep_sample_n() as an alternative to the n/size arguments for specifying the proportion of rows in the supplied data to sample per replicate.

Closes #361. :-)

uses a rep_sample_internal function to error more informatively without any match.call trickiness to figure out which of size or n is the right thing to mention in an error.

introduces a prop argument, but ignored so far!
adds an example with prop and generally uses rep_slice_sample() over the superseded rep_sample_n(), as well as adding a NEWS entry
@echasnovski
Copy link
Collaborator

I'll a little bit short on time lately. I remember about this :)
The initial thought was that it is somewhat overcomplicated and it should be possible to simplify, but I didn't have time to actually do this.

Copy link
Collaborator

@echasnovski echasnovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to go ahead and approve these. @simonpcouch , you did a great job dealing with a clutter of overlapping but slightly different functionality. I think that my initial reaction of "overcomplication" comes from two issues:

  • Confusing interception of functionalities and overall implementation design. This should be fixed with a complete ideological refactor (will open an issue).
  • Having all size, n, prop, in_slice, and missing_size in rep_sample_internal(). It is probably a good idea to validate sample size in every function (rep_sample_n() and rep_slice_sample()) separately and have *_internal() only have single size argument.

@simonpcouch
Copy link
Collaborator Author

Closing in favor of #363. :-)

@github-actions
Copy link

github-actions bot commented Mar 8, 2021

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2021
@simonpcouch simonpcouch deleted the rep-slice-sample-prop branch May 28, 2021 21:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add prop argument to rep_slice_sample()
2 participants