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.
library(tidyverse)
library(sf)
## Create a tibble, and then make it an sf object
dftest <- tribble(
~tag, ~lat, ~lon,
"a", 30.00000, -95.000000,
"b", 30.10000, -95.100000
)
is.data.frame(dftest)
dftest <- st_as_sf(dftest, coords=c('lon', 'lat'), crs=4326)
is.data.frame(dftest)
add_row(dftest, tag="c")