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
Problems with dplyr bind_row() and tidyr pivot_longer() in combination with vctrs after upgrade. #999
Comments
|
Looks like this is related to #694 |
|
And #981. |
Just as a clarification and since I did look briefly at the comments of #694 and #981 and saw the comments about the different data types (e.g. data frame and data table). While this is true for the Again... just a quick clarification. |
|
They are considered different types by vctrs because the column types are not identical. There is a library(dplyr, warn.conflicts = FALSE)
library(data.table, warn.conflicts = FALSE)
packageVersion("dplyr")
#> [1] '0.8.99.9002'
df1 <- data.table(x = 1, y = 2)
df2 <- data.table(x = 3, y = 4)
bind_rows(df1, df2)
#> x y
#> 1: 1 2
#> 2: 3 4
df3 <- data.table(x = 3, y = 4, z = 5)
bind_rows(df1, df3)
#> Error: Can't combine `..1` <data.table<
#> x: double
#> y: double
#> >> and `..2` <data.table<
#> x: double
#> y: double
#> z: double
#> >>.Created on 2020-04-08 by the reprex package (v0.3.0) |
|
Understood! |
|
I'm also getting |
Hi,
I was tempted and did the upgrade to the development version of
dplyrafter reading a bit in the blog post from @hadley released earlier this week. Unfortunately, this broke my existing script at two locations, once (so far I have to say) at adplyr::bind_rowsposition and once at atidyr::pivot_longerposition.During the upgrade of
dplyrto the development version,vctrswas updated as well.I will not post my whole script here, since this would be too much, so I stored my environment prior to the error and just run the function creating the error in the code section below. I did not change anything on the script itself! The only things I changed between the executions are the versions of either
dplyrorvctrsand a downgrade (installation from CRAN) ofdplyrandvctrsrestored my script.Created on 2020-04-08 by the reprex package (v0.3.0)
A downgrade of
dplyralone (notvctrs) resolved the issue with thedplyr::bind_rows()function, as seen below.Created on 2020-04-08 by the reprex package (v0.3.0)
The
tidyr::pivot_longer()was of course not resolved by downgradingdplyr. Here, a downgrade ofvctrsresolved the issue, as shown using bothreprexoutputs below. The first output usesvctrsversion 0.2.99.9011 and results in an error, the other one was executed after a downgrade ofvctrsand did not produce any errors.Created on 2020-04-08 by the reprex package (v0.3.0)
Traceback for this error is:
Code which executes just fine with
vctrsversion 0.2.4:Created on 2020-04-08 by the reprex package (v0.3.0)
I hope all this is clearly explained. I know this might not be the best way of a submission of an issue today, but I wanted to put this out in case it is not reported yet (I saw some discussion about
vctrsand row binding...)Thanks much for the support!
The text was updated successfully, but these errors were encountered: