return a separate object for every input sub-object (not yet implemented)
.id
optional name for output attribute name
...
arguments for methods
clipboard
WIP this special-case allows x to be the result of the leafem clipboard copy process
Value
'SpatialPolygonsDataFrame'
Warning
Please note that an extent converted to polygons consists
of only four unique coordinates, and so this is not necessarily suited for
projection transformations.
Details
Called with no arguments will return the extent of the current 'par("usr")' setting.
Called with a matrix, list, or data frame it will create an extent from a two columned thing.
Called with clipboard = TRUE and x will be treated as the JSON-ic output of the clipboard copy from
leafem (WIP). If x is missing, it will be attempted to be read from the clipboard. Clipboard read cannot
work on RStudio Server, so we allow the text value to be passed in.
I.e. spex(clipboard = TRUE) will
read from the clipboard, spex(tx, clipboard = TRUE) will read from tx with value like
'{"_southWest":{"lat":-1.307259612275665,"lng":23.411865234375},"_north...}"'.
This function is to replace a common pattern in spatial packages which is
create an Extent-class, a bounding box in xmin,xmax,ymin,ymax but without projection metadata
# NOT RUN {library(raster)
data(lux)
exlux <- spex(lux)
plot(lux)
plot(exlux, add = TRUE)
## put an extent and a CRS togetherspex(extent(0, 1, 0, 1), crs = "+proj=laea +ellps=WGS84")
# }