-
Notifications
You must be signed in to change notification settings - Fork 80
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
rep_sample_n() error when prob vector specified #279
Comments
Also, I'm wondering if per tidy principles, we should force/require that the sampling probabilities be specified as a variable |
Indeed, this was based on
Also, since we're talking about |
Sounds good. @andrewpbray, could you please let me know your reasoning? I'll then PR |
Hi all, thanks for your help in understanding how to do this. Currently the code:
A temporary workaround, which returns a warning, is to make sure exactly of those points: that the tibble contains a column called
|
This comment has been minimized.
This comment has been minimized.
Removing @andrewpbray as the assignee here. @echasnovski or @simonpcouch, can you look into this whenever you get a chance? |
Hi everyone, I hope you are well. I just thought this might help in getting started.
Hope this helps, |
also adds a new rep_slice_sample wrapper that has a more similar interface to dplyr::slice_sample(). still need to extend unit testing and rewrite examples.
Starting to give a go at this on the branch linked above—will drop a link to here in the PR once it's ready! @unoe, your draft was really helpful. :-) |
🦋 |
This issue 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. |
An issue was brought to my attention by @unoe w.r.t. to specifying non-uniform sampling probabilities. Here is a reprex:
I've traced the issue to https://github.com/tidymodels/infer/blob/master/R/rep_sample_n.R#L59. In fact, there is a residual
there should be a better way!!
comment! In short,rep_sample_n()
currently assumes that the variable of interest to sample isfactor
I'm happy to file a PR to fix this, however I'm not quite sure I understand why the following code on lines 69-73 are necessary, instead of just using the
prob
argument as isJudging by #82, it seems @mine-cetinkaya-rundel wrote this function back in the day for
oilabs
. Mine, could you shed some light as to necessity of the above wrangling?The text was updated successfully, but these errors were encountered: