Typology Layer

Share:

Description

Plot a typology layer.

Usage

1
2
3
4
5
6
typoLayer(spdf, df, spdfid = NULL, dfid = NULL, var, col = NULL,
  border = "grey20", lwd = 1, colNA = "white",
  legend.pos = "bottomleft", legend.title.txt = var,
  legend.title.cex = 0.8, legend.values.cex = 0.6,
  legend.values.order = NULL, legend.nodata = "no data",
  legend.frame = FALSE, add = FALSE)

Arguments

spdf

a SpatialPolygonsDataFrame.

df

a data frame that contains the values to plot. If df is missing spdf@data is used instead.

spdfid

identifier field in spdf, default to the first column of the spdf data frame. (optional)

dfid

identifier field in df, default to the first column of df. (optional)

var

name of the field in df to plot.

col

a vector of colors.

border

color of the polygons borders.

lwd

borders width.

colNA

no data color.

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.order

values order in the legend, a character vector that matches var modalities. Colors will be affected following this order.

legend.nodata

no data label.

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).

See Also

propSymbolsTypoLayer, typoLayer, legendTypo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(nuts2006)
## Example 1
nuts0.df$typo <- c(rep("A",10),rep("B",10),rep("C",10),rep("D",4))
typoLayer(spdf = nuts0.spdf, df = nuts0.df, var = "typo") 


## Example 2
nuts0.df$typo <- c(rep("A",10),rep("B",10),rep("C",10),rep("D",4))
typoLayer(spdf = nuts0.spdf, df = nuts0.df,
          var="typo",  col = carto.pal(pal1 = "multi.pal", 4),
          legend.values.order = c("D", "B", "A", "C"),
          legend.pos = "topright", 
          legend.title.txt = "Category")
layoutLayer(title = "Colors in Europe",
            sources = "UMS RIATE, 2015",
            scale = NULL,
            frame = TRUE,
            col = "black",
            coltitle = "white")

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