
Map Hill numbers (and coverage) in geographic space
plot_geo.RdPlots site-level diversity estimates as points on an sf map, with an
optional raster backdrop. Uses theme_tidymapr() and the
colour-blind-safe Okabe-Ito / viridis scales.
Usage
plot_geo(
data,
value = NULL,
lon = lon,
lat = lat,
basemap = "esri",
raster = NULL,
coastline = NULL,
size = 3,
label = NULL,
scale_bar = TRUE,
north_arrow = TRUE,
scale_bar_km = NULL,
scale_units = c("metric", "imperial", "both"),
legend_title = NULL,
legend_position = "auto",
legend_frame = TRUE,
inset = FALSE,
admin = NULL,
admin_level = 1,
admin_fill = FALSE
)Arguments
- data
An
sfobject or a data frame withlon/latand an estimate column (for example the output oftidydiversity::div_estimate()joined to coordinates withtidydiversity::add_site_data()/geo_as_sf()).- value
<
data-masking> Column to map (fill / size).- lon, lat
Coordinate columns when
datais notsf.- basemap
Basemap:
"none","coast", tile name, SpatRaster or path. Seegeo_basemap().- raster
Optional
SpatRasterbackdrop (used whenbasemapis"none").- coastline
Optional coastline
sffor a coast basemap.- size
Point size, or a bare column mapped to point size (combined with
valuelike tmap size + col, e.g. Hill number and elevation).- label
Optional column of site labels.
- scale_bar, north_arrow
Draw a scale bar and north arrow?
TRUEuses the default style,FALSEnone, or name a style (seeannotation_scale_bar()).- scale_bar_km
Length of the scale bar in kilometres.
- scale_units
Scale bar units:
"metric","imperial"or"both".- legend_title
Optional legend title (defaults to the value column).
- legend_position
"auto"(collision-aware inside corner),"outside", or a corner"bl"/"br"/"tl"/"tr".- legend_frame
Draw a frame around an inside legend?
- inset
Overview map:
FALSE,TRUE/"auto","png", or a length-4 bbox. Uses the same collision reservation as the scale bar and north arrow. PNG insets prefer GADM provinces when cached.- admin
Optional administrative boundaries (
sfor ISO3 code); seeplot_sites().- admin_level
GADM level when
adminis a country code.- admin_fill
Fill admin polygons instead of outlines only.
