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

Can't convert <character> to <integer> with names_ptypes #933

Closed
abichat opened this issue Apr 21, 2020 · 1 comment
Closed

Can't convert <character> to <integer> with names_ptypes #933

abichat opened this issue Apr 21, 2020 · 1 comment

Comments

@abichat
Copy link

abichat commented Apr 21, 2020

The example given in the vignette "Pivoting" with the use of names_ptypes argument is not reproducible with tidyr 1.0.2.

> library(tidyr)
> billboard %>% 
+   pivot_longer(
+     cols = starts_with("wk"), 
+     names_to = "week", 
+     names_prefix = "wk",
+     names_ptypes = list(week = integer()),
+     values_to = "rank",
+     values_drop_na = TRUE,
+   )
Erreur : Can't convert <character> to <integer>.
Run `rlang::last_error()` to see where the error occurred.
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

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

other attached packages:
[1] tidyr_1.0.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.8      packrat_0.5.0     crayon_1.3.4      dplyr_0.8.99.9002 R6_2.4.1          lifecycle_0.2.0  
 [7] magrittr_1.5      pillar_1.4.3      stringi_1.4.6     rlang_0.4.5.9000  rstudioapi_0.11   vctrs_0.2.99.9011
[13] generics_0.0.2    ellipsis_0.3.0    tools_3.6.3       glue_1.4.0        purrr_0.3.4       compiler_3.6.3   
[19] pkgconfig_2.0.3   tidyselect_1.0.0  tibble_3.0.1   
@hadley
Copy link
Member

hadley commented Apr 21, 2020

Duplicate of #921

@hadley hadley marked this as a duplicate of #921 Apr 21, 2020
@hadley hadley closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants