-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix sf combination with multiple chunks #1136
Comments
One way to fix this is to implement ptype2 methods for sf. From https://github.com/r-spatial/sf/blob/2ca6483f08555185bd55a05d478025f5d1d73b1c/R/bind.R#L18-L34
|
Another way is to remove the use of a common-type sentinel for the |
Of course we have the same problem when implementing sfc1 <- sf::st_sfc(sf::st_point())
sfc2 <- sf::st_sfc(sf::st_linestring())
sf1 <- sf::st_sf(geo1 = sfc1)
sf2 <- sf::st_sf(geo2 = sfc2)
vec_rbind(sf1, sf2)
=>
# Within `vec_ptype2.sf.sf()`:
data = df_ptype2(x, y, ...)
lapply(data, class)
#> $geo1
#> [1] "vctrs:::common_class_fallback"
#>
#> $geo2
#> [1] "vctrs:::common_class_fallback"
|
Reverts r-spatial#1335 Part of r-lib/vctrs#1136
From r-spatial/sf#1390 (comment)
This is a bad interaction between the
c()
fallback invec_rbind()
, which currently creates a sentinel column in the common type, and the same-type fallback for foreign data frames, which calls[<-
to update the inputs with the common-type column structure.The text was updated successfully, but these errors were encountered: