Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/mapCirclesChoro.R
This function represents two variables through a proportional circles map. The areas of the circles are proportional to values of a quantitative variable and their colors reflect the discretization of an other numeric variable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | mapCirclesChoro(shpFile, shpId, df, dfId, var, var2,
fixedNorm = FALSE, shareOfCircles = 0.02,
radiusMax = 0.5, valueMax = max(df[, var], na.rm = TRUE),
lgdRndCircles = 0, posLegCircles = "topright",
circleCol = "grey", baseCol = "#FFEDA0",
nclass = 6, style = "quantile", fixBrks = FALSE, listBrks = NULL,
diverg = FALSE, divergBrk = 0,
palCol = "Greens", palColPos = "Reds", palColNeg = "Blues",
NACol = "grey",
lgdRndDistr = 2, posLegDistr = "bottomleft",
title = paste(var, var2, sep = " & "),
legendCircles = var, legendDistr = var2,
author = "author", sources = "sources",
scalebar = FALSE, scalebarSize, scalebarText,
northArrow = FALSE, northArrowSize,
width = NULL, height = NULL, txtCex = NULL)
|
shpFile |
Path to a polygon shapefile. |
shpId |
Unique identifier of the shapefile. It must correspond to |
df |
Data frame that contains the variables to be mapped. |
dfId |
Unique identifier of the data frame. It must correspond to |
var |
Name of the positive numeric variable to be mapped through the sizes of the circles. |
var2 |
Name of the positive numeric variable to be mapped through the colors of the circles. |
fixedNorm |
|
shareOfCircles |
Share of the surface of the map occupied by circles (0.02 is 2%). |
radiusMax |
Size (in cm) of the radius of the biggest circle. |
valueMax |
Value used to normalize the size of the largest circle (in variable units). |
lgdRndCircles |
Rounding of the values of the variable presented in the legend of the circles. |
posLegCircles |
Position of the legend of the circles(top, bottom, left, right, center, topleft, topright, bottomleft or bottomright). |
circleCol |
Color of the circles in the legend |
baseCol |
Color of the base map. |
nclass |
Number of classes to be represented. |
style |
Method used to provide the class intervals.
See |
fixBrks |
|
listBrks |
Vector of values used as breaks for the class intervals when |
diverg |
|
divergBrk |
Value used to define the break in the color palette if |
palCol |
Color palette, provided through |
palColPos |
Palette used for values superior to |
palColNeg |
Palette used for values inferior to |
NACol |
Color used to draw units with no data ( |
lgdRndDistr |
Rounding of the class intervals presented in the legend. |
posLegDistr |
Position of the legend of the discretization (top, bottom, left, right, center, topleft, topright, bottomleft or bottomright). |
title |
Title of the map. |
legendCircles |
Title of the legend for the circles |
legendDistr |
Title of the legend for the discretization |
author |
Two lines ( |
sources |
Two lines ( |
scalebar |
|
scalebarSize |
Size of the scale bar in map units. |
scalebarText |
Text of the scale bar. |
northArrow |
|
northArrowSize |
Size of the North arrow in map units. |
width |
Width of the map in cm. |
height |
Height of the map in cm. |
txtCex |
Size of the texts. |
The circles are centered on the centroids of the polygons.
Only the six first arguments are compulsory.
A map is displayed in the graphic window.
You can export the map in raster or vector format (pdf).
Timothee Giraud - UMS RIATE (CNRS)
rCarto-package | rCarto package |
mapCircles | proportional circles |
mapCirclesChoro | proportional circles colored by a discretized quantitative variable |
mapCirclesTypo | proportional circles colored by the modalities of a qualitative variable |
mapChoropleth | choropleth |
mapChoroTypo | typology |
mtq | data |
commune | shapefile |
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.