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

rep_slice_sample unused argument error in vctrs:vec_chop #537

Closed
robrill opened this issue Mar 26, 2024 · 4 comments
Closed

rep_slice_sample unused argument error in vctrs:vec_chop #537

robrill opened this issue Mar 26, 2024 · 4 comments

Comments

@robrill
Copy link

robrill commented Mar 26, 2024

Running a simple repeated sampling from mtcars:

library(dplyr)
library(infer)
data(mtcars)

slices <-  rep_slice_sample(mtcars, n = 50, reps = 1000)

#OR

slices <- rep_sample_n(mtcars, size=50, replace = TRUE, reps = 1000, prob = mtcars$wt)

return the following errors:


`Error in vctrs::vec_chop(seq_len(n * reps), sizes = rep(n, reps)): unused argument (sizes = rep(n, reps))`

`Error in vctrs::vec_chop(idx_list, sizes = rep(size, reps)) : 
  unused argument (sizes = rep(size, reps))
Error in vctrs::vec_chop(idx_list, sizes = rep(size, reps)): unused argument (sizes = rep(size, reps))
`

Here's session info:



sessionInfo()

R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] infer_1.0.7 dplyr_1.1.0

loaded via a namespace (and not attached):
 [1] fansi_1.0.4      utf8_1.2.3       SparkR_3.4.1     grid_4.2.2      
 [5] R6_2.5.1         gtable_0.3.1     lifecycle_1.0.3  magrittr_2.0.3  
 [9] scales_1.2.1     ggplot2_3.4.0    pillar_1.8.1     rlang_1.0.6     
[13] cli_3.6.0        vctrs_0.5.2      generics_0.1.3   tools_4.2.2     
[17] glue_1.6.2       purrr_1.0.1      munsell_0.5.0    compiler_4.2.2  
[21] colorspace_2.1-0 pkgconfig_2.0.3  Rserve_1.8-12    tidyselect_1.2.0
[25] tibble_3.1.8    

Did a little sleuthing but haven't been able to track down what's breaking it. A change to vctrs?

Thanks for all the hard work on a great package!

@robrill robrill closed this as completed Mar 26, 2024
@simonpcouch
Copy link
Collaborator

Thanks for the issue! Did you intend to close this issue as completed?

@simonpcouch
Copy link
Collaborator

Looks like my vctrs version is quite a bit newer than yours, so maybe we have an unstated dependency on a relatively new vctrs argument.

@robrill
Copy link
Author

robrill commented Mar 27, 2024

Ha, yep--realized right after I wrote it up that vec_chop in vctrs 0.5.2 didn't take sizes as an argument yet. Updated it and solved the problem. Thanks for checking!

simonpcouch added a commit that referenced this issue Mar 27, 2024
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants