Skip to content

Commit

Permalink
Merge pull request #269 from rOpenGov/cache
Browse files Browse the repository at this point in the history
Make get_eurostat_geospatial usable without sf package
  • Loading branch information
pitkant authored Aug 18, 2023
2 parents be2b98d + 61db0b8 commit e03bdbb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/get_eurostat_geospatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,15 @@ get_eurostat_geospatial <- function(output_class = "sf",

# to df
if (output_class == "df") {
# Remove geometry
shp <- sf::st_drop_geometry(shp)
# nocov start
if (!requireNamespace("sf", quietly = TRUE)) {
# Remove geometry without sf package
shp$geometry <- NULL
# nocov end
} else {
# Remove geometry
shp <- sf::st_drop_geometry(shp)
}
}

return(shp)
Expand Down

0 comments on commit e03bdbb

Please sign in to comment.