Function to produce static maps for France statistical unit.
mappingFR(data, var = NULL, colID = NULL,
type = c("static", "interactive"),
typeStatic = c("tmap", "choro.cart", "typo", "bar"),
unit = c("region"), year = c("2021", "2020", "2019"),
matchWith = c("name", "code"),
dir = NULL, add_text = NULL, subset = NULL, facets = NULL,
aggregation_fun = sum, aggregation_unit = NULL,
options = mapping.options())
Return a map. For tmap
type, the function also returns a tmap
object.
a data.frame object with variables to display or a UK
object produced by FR
function. If object of class FR
, arguments unit
, year
, and matchWith
will be ignored
character value(s) or columns number(s) indicating the variable to plot
character value or columns number indicating the column with unit names
if generates static or interactive map
type of static map
the type of Italian statistical unit
year of the unit
the type of id to check:
"name" | if unit names). |
"code" | if unit code |
local directory in which shape files are stored
character name indicating the column with text labels
a formula indicating the condition to subset the data. See the details section
variable(s) name to split the data
function to use when data are aggregated
variable name by which the unit are aggregated
a list with options using mapping.options
function
If data
is a object of class "UK" generated using the UK
function, the arguments unit
, and year
are ignored, because the object already contains the coordinates.
subset
provide an expression to subsetting the data
using a formula, with the logical operators. For example data can be subsetting as follows: ~I("Variable 1" == "condition 1" & "Variable 2" != "condition 2")
or for example, ~I("Variable 1" > "condition 1" | "Variable 2" != "condition 2")
.
Giraud, T. and Lambert, N. (2016). cartography: Create and Integrate Maps in your R Workflow. JOSS, 1(4). doi: 10.21105/joss.00054.
Pebesma, E., 2018. Simple Features for R: Standardized Support for Spatial Vector Data. The R Journal 10 (1), 439-446, https://doi.org/10.32614/RJ-2018-009
Tennekes M (2018). “tmap: Thematic Maps in R.” _Journalstatisticaltical Software_, *84*(6), 1-39. doi: 10.18637/jss.v084.i06 (URL: https://doi.org/10.18637/jss.v084.i06).
mappingWR
,mappingEU
, mappingUS
, mappingDE
data("popFR")
# \donttest{
fr <- FR(data = popFR)
###############
# Statics #
###############
mappingFR(data = fr, var = "population", subset = ~I(region == "corse"))
# }
Run the code above in your browser using DataLab