Convert from dplyr tbl form to Spatial*DataFrame.

sp(x, ...)

# S3 method for data.frame
sp(x, attr_tab = NULL, crs, ...)

Arguments

x

tibble as created by sptable

...

unused

attr_tab

remaining data from the attributes

crs

projection, defaults to NA_character_

Value

Spatial*

Examples

library(dplyr)
#> #> Attaching package: ‘dplyr’
#> The following object is masked from ‘package:testthat’: #> #> matches
#> The following objects are masked from ‘package:stats’: #> #> filter, lag
#> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union
semap1 <- semap %>% dplyr::filter(y_ > -89.9999) sp_obj <- sp(semap1, attr_tab = seatt, crs = "+proj=longlat +ellps=WGS84") ## look, seamless Antarctica! ## library(rgdal); plot(spTransform(sp_obj, "+proj=laea +lat_0=-70"))