-
Notifications
You must be signed in to change notification settings - Fork 301
Closed
Description
I see that working with sf
objects with dplyr
is listed on the ISC Proposal, but it looks like you haven't gotten around to documenting that yet.
Without going into a vignette-length explanation, could you shed some light on why dplyr
functions appear to strip sf
objects of their sf
class and suggest a way to effectively combine the power of these two tools?
Example:
library(dplyr)
library(sf)
nc <- st_read(system.file("shapes/", package="maptools"), "sids")
## Reading layer sids from data source
## /Library/Frameworks/R.framework/Versions/3.3/Resources/library/maptools/shapes/ using driver "ESRI Shapefile"
## features: 100
## fields: 14
## converted into: MULTIPOLYGON
class(nc)
## [1] "sf" "data.frame"
class(nc[nc$AREA > .1,])
## [1] "sf" "data.frame"
class(dplyr::filter(nc,AREA > .1))
## [1] "data.frame"
Many thanks.
jsta and gregmacfarlane
Metadata
Metadata
Assignees
Labels
No labels