Created
December 11, 2019 14:18
-
-
Save infotroph/8f6f294d5047dabe0d524724c64b2604 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> tribble(~"X0.0 cm", ~"X1.5 cm", 1, 2) %>% | |
+ pivot_longer( | |
+ cols = everything(), | |
+ names_pattern = "X([\\d.]+) cm", | |
+ names_ptypes = list(name=double())) | |
Error: Lossy cast from `x` <character> to `to` <double>. | |
Locations: 1 | |
Run `rlang::last_error()` to see where the error occurred. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From
?pivot_longer
If
vctrs
is going to complain about any char-to-double conversion, I don't see hownumeric
can work as documented.