Description Usage Arguments Details Value Author(s) See Also Examples
Add the label
column of data
to the existing plot.
1 2 3 |
data |
EventData or PolyData to add (required). |
xlim |
range of X-coordinates. |
ylim |
range of Y-coordinates. |
polyProps |
PolyData specifying which labels to plot and their
properties. |
placement |
one of |
polys |
PolySet to use for calculating label placement. |
rollup |
level of detail at which to process |
cex |
vector describing character expansion factors (cycled by
|
col |
vector describing colours (cycled by |
font |
vector describing fonts (cycled by |
... |
additional |
If data
is EventData, it must minimally contain the columns
EID
, X
, Y
, and label
. Since the
EID
column does not match a column in polys
, set
placement = "DATA"
. The function plots each label
at
its corresponding X
/Y
coordinate.
If data
is PolyData, it must minimally contain the columns
PID
and label
. If it also contains X
and
Y
columns, set placement = "DATA"
to plot labels at
those coordinates. Otherwise, set placement
to one of
"CENTROID"
, "MEAN_RANGE"
, or "MEAN_XY"
. When
placement != "DATA"
, supply a PolySet polys
. Using this
PolySet, the function calculates a centroid, mean range, or mean X/Y
coordinate for each polygon, and then links those PolyData with
data
by PID
/SID
to determine label
coordinates.
If data
contains both PID
and EID
columns, the
function assumes it is PolyData and ignores the EID
column.
For additional help on the arguments cex
, col
, and
font
, please see par
.
EventData or PolyData with X
and Y
columns
that can subsequently reproduce the labels on the plot. Modify this
data frame to tweak label positions.
Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10
addPoints
,
calcCentroid
,
calcMidRange
,
calcSummary
,
EventData,
plotPoints
,
PolyData.
1 2 3 4 5 6 7 8 9 10 11 12 13 | local(envir=.PBSmapEnv,expr={
oldpar = par(no.readonly=TRUE)
#--- create sample PolyData to label Vancouver Island
labelData <- data.frame(PID=33, label="Vancouver Island");
#--- load data
if (!is.null(version$language) && (version$language == "R"))
data(nepacLL,envir=.PBSmapEnv)
#--- plot the map
plotMap(nepacLL,xlim=c(-129,-122.6),ylim=c(48,51.1),col="lemonchiffon")
#--- add the labels
addLabels(labelData,placement="CENTROID",polys=nepacLL,cex=1.2,col=2,font=2)
par(oldpar)
})
|
sh: 1: cannot create /dev/null: Permission denied
-----------------------------------------------------------
PBS Mapping 2.70.4 -- Copyright (C) 2003-2017 Fisheries and Oceans Canada
PBS Mapping comes with ABSOLUTELY NO WARRANTY;
for details see the file COPYING.
This is free software, and you are welcome to redistribute
it under certain conditions, as outlined in the above file.
A complete user guide 'PBSmapping-UG.pdf' is located at
/usr/lib/R/site-library/PBSmapping/doc/PBSmapping-UG.pdf
Packaged on 2017-06-28
Pacific Biological Station, Nanaimo
All available PBS packages can be found at
https://github.com/pbs-software
To see demos, type '.PBSfigs()'.
-----------------------------------------------------------
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.