Add labels to a map
text.Rd
Plots labels, that is a textual (rather than color) representation of values, on top an existing plot (map).
Usage
# S4 method for class 'SpatRaster'
text(x, labels, digits=0, halo=FALSE, ...)
# S4 method for class 'SpatVector'
text(x, labels, halo=FALSE, inside=FALSE, ...)
Arguments
- x
SpatRaster or SpatVector
- labels
character. Optional. Vector of labels with
length(x)
or a variable name fromnames(x)
- digits
integer. How many digits should be used?
- halo
logical. If
TRUE
a "halo" is printed around the text. IfTRUE
, additional argumentshc="white"
andhw=0.1
can be modified to set the color and width of the halo- inside
logical. Should the text always be placed inside one the sub-geometries?
- ...
additional arguments to pass to graphics function
text