Skip to content

add_row fails on sf object with bogus error message #662

@alankjackson

Description

@alankjackson

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions