Convert from dplyr tbl form to Spatial*DataFrame.
sp(x, ...)
# S3 method for data.frame
sp(x, attr_tab = NULL, crs, ...)
tibble as created by sptable
unused
remaining data from the attributes
projection, defaults to NA_character_
Spatial*
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> 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")
#> New names:
#> • `object_` -> `object_...1`
#> • `object_` -> `object_...7`
## look, seamless Antarctica!
## library(rgdal); plot(spTransform(sp_obj, "+proj=laea +lat_0=-70"))