Learn R Programming

quickmapr (version 0.3.0)

l: Label features

Description

It is useful to be able to provide labels to features on your map when examining the results of given analysis. This function adds labels for a given layer (currently just point or polygon layers).

Usage

l(qmap_obj, field = NULL, layer = 1)

Arguments

qmap_obj

a qmap object from which to pull the labels. Raster layers are ignored. Will also accept sp objects.

field

a field in the sp object to use to label the features. Defaults to row.names().

layer

identify which sp layer to label. Defaults to first layer in qmap_obj$map_data.

Examples

Run this code
# NOT RUN {
data(lake)
qm<-qmap(lake,width,buffer)
l(qm,'COMID')
l(qm, layer = 2)
l(qm, layer = "buffer")
# }

Run the code above in your browser using DataLab