Specify a shape, which is a spatial object from one of these spatial object
class packages: sf
, stars
, or terra
.
Usage
tm_shape(
shp,
bbox = NULL,
crs = NULL,
is.main = NA,
name = NULL,
unit = NULL,
filter = NULL,
...
)
Arguments
- shp
Spatial object
- bbox
Bounding box of the map (only used if
shp
is the main shape (seeis.main
)- crs
CRS to which
shp
is reprojected (only used ifis.main = TRUE
)- is.main
Is
shp
the main shape, which determines the crs and bounding box of the map? By default,TRUE
if it is the firsttm_shape
call- name
Name of the shape
- unit
Unit of the coordinates
- filter
Filter features
- ...
passed on to
bb
(e.g.ext
can be used to enlarge or shrink a bounding box)
Examples
tm_shape(World, crs = "+proj=ortho +lat_0=-10 +lon_0=-30") +
tm_polygons()
tm_shape(World, crs = "+proj=robin", filter = World$continent=="Africa") +
tm_polygons()