Methods for 'dplyr' verbs for 'sp' 'Spatial' classes. The basic verbs that modify data attributes, remove or re-arrange rows are supported and provide complete 'Spatial' analogues of the input data. The group by and summarize work flow returns a non-topological spatial union. There is limited support for joins, with left and inner to copy attributes from another table.
spdplyr provides methods for the
dplyr verbs for the
Spatial classes in the
Install from CRAN:
The development version of
spdplyr can be installed directly from Github:
dplyr verbs to the attribute data of
sp objects with dplyr verbs.
?dplyr-Spatial' for supported verbs.
Most of it is easy, simply applying the analogous operation of the verb to the Spatial*DataFrame and subsetting/re-organizing as necessary. Some operations use the
spbabel::sptable approach which provides a loss-less way to do what
ggplot2::fortify does and its reverse.
NOTE: joins aren't really thought through or developed properly, send me your feedback / ideas / help!
updated to use sp rather than spFromTable in line with spbabel
modified the print/show details for Spatial
removed some leftover references from original source
first working version
forked from spbabel 0b95adb3, previous news is from spbabel originally
various improvements provided by jlegewie, removed transmute_ (not needed), improved filter_ and select_, added left_join and inner_join, see https://github.com/mdsumner/spbabel/pull/10
added group_by and complementary summarize capability for Spatial
set data.frame and tbl and tbl_df as S4 compatible