Add labels to a map
Plots labels, that is a textual (rather than color) representation of values, on top an existing plot (map).
## S4 method for signature 'SpatRaster' text(x, labels, digits=0, halo=FALSE, ...) ## S4 method for signature 'SpatVector' text(x, labels, halo=FALSE, ...)
x |
SpatRaster or SpatVector |
labels |
character. Optional. Vector of labels with |
digits |
integer. how many digits should be used? |
halo |
logical. If |
... |
additional arguments to pass to graphics function |
r <- rast(nrows=4, ncols=4) values(r) <- 1:ncell(r) plot(r) text(r) plot(r) text(r, halo=TRUE, hc="blue", col="white", hw=0.2) plot(r, col=rainbow(16)) text(r, col=c("black", "white"), vfont=c("sans serif", "bold"), cex=2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.