-
Notifications
You must be signed in to change notification settings - Fork 129
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
add_row fails on sf object with bogus error message #662
Comments
With the most recent package versions, I'm now seeing: library(tidyverse)
library(sf)
#> Linking to GEOS 3.6.2, GDAL 2.2.3, PROJ 4.9.3
dftest <- tribble(
~tag, ~lat, ~lon,
"a", 30.00000, -95.000000,
"b", 30.10000, -95.100000
)
dftest <- st_as_sf(dftest, coords=c('lon', 'lat'), crs=4326)
new_dftest <- add_row(dftest, tag = "a")
print(new_dftest)
#> Error in error_need_scalar(): could not find function "error_need_scalar"
attributes(new_dftest)
#> $names
#> [1] "tag" "geometry"
#>
#> $class
#> [1] "sf" "tbl_df" "tbl" "data.frame"
#>
#> $row.names
#> [1] 1 2 3 Created on 2019-10-23 by the reprex package (v0.3.0) The operation succeeds but creates an invalid sf object. @edzer: Would you like |
I haven't run into needing it, but I wouldn't object if it worked! |
For this to work, sf needs to be at least aware of vctrs -- or the other way round... |
Calling |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
Applying add_row to an sf object emits the error:
Error: is.data.frame(.data) is not TRUE
yet that test is actually passed by the sf object. At minimum the error message
should be clearer.
The text was updated successfully, but these errors were encountered: