Proportional Links Layer

Description

Plot a layer of proportional links. Links widths are directly proportional to values of a variable.

Usage

1
2
3
4
propLinkLayer(spdf, df, spdfid = NULL, spdfids, spdfide, dfid = NULL, dfids,
  dfide, var, maxlwd = 40, col, legend.pos = "bottomleft",
  legend.title.txt = var, legend.title.cex = 0.8, legend.values.cex = 0.6,
  legend.values.rnd = 0, legend.frame = FALSE, add = TRUE)

Arguments

spdf

a SpatialLinesDataFrame; a link layer.

df

a data frame with identifiers and a variable.

spdfid

unique identifier in spdf (spdfids, spdfide, dfids and dfide are not used).

spdfids

identifier of starting points in spdf (spdfid and dfid are not used).

spdfide

identifier of ending points in spdf (spdfid and dfid are not used).

dfid

unique identifier in df (spdfids, spdfide, dfids and dfide are not used).

dfids

identifier of starting points in df (spdfid and dfid are not used).

dfide

identifier of ending points in df (spdfid and dfid are not used).

var

name of the variable used to plot the links widths.

maxlwd

maximum size of the links.

col

color of the links.

legend.pos

position of the legend, one of "topleft", "top", "topright", "left", "right", "bottomleft", "bottom", "bottomright". If legend.pos is "n" then the legend is not plotted.

legend.title.txt

title of the legend.

legend.title.cex

size of the legend title.

legend.values.cex

size of the values in the legend.

legend.values.rnd

number of decimal places of the values displayed in the legend.

legend.frame

whether to add a frame to the legend (TRUE) or not (FALSE).

add

whether to add the layer to an existing plot (TRUE) or not (FALSE).

Note

Unlike most of cartography functions, identifiers fields are mandatory.

See Also

gradLinkLayer, getLinkLayer, legendPropLines

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("nuts2006")
# Create a link layer of the twin cities agreements
twincities.spdf <- getLinkLayer(spdf = nuts2.spdf, df = twincities[,1:2])
# Plot the links - Twin cities agreements between regions 
plot(nuts0.spdf, col = "grey60",border = "grey20")
propLinkLayer(spdf = twincities.spdf, df = twincities[twincities$fij>=5,],maxlwd = 10,
              spdfids = "i", spdfide = "j",
              dfids = "i", dfide = "j",legend.pos = "topright",
              var = "fij", 
              col = "#92000090", add = TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.