thematic.map: thematic.map

View source: R/thematic.map.R

thematic.mapR Documentation

thematic.map

Description

Draw thematic maps together with histograms with a Spatial or sf object, background layers according to variables and shading schemes.

Usage

thematic.map(data, var.names, colorStyle = NULL, na.pos = "bottomright", bglyrs, bgStyle,
                         scaleBar.pos = "bottomright", mtitle = NULL, htitle = NULL,
                         legend = "Legend", legend.pos = "topright", cuts = 5, 
                         cutter = quantileCuts, horiz = FALSE, digits=2,...)

Arguments

data

A Spatial or sf object.

var.names

A vector of variable names to be mapped

colorStyle

A vector of colors (including "red", "blue" and "green") or a color function, e.g. rainbow, heat.colors, hcl.colors, terrain.colors and colors

na.pos

A 2-D coordinate or character to define the position of north arrow, i.e. "topright", "topleft", "bottomright", "bottomleft"

bglyrs

A list of background layers of "Spatial" or "sf" objects

bgStyle

A list of parameters for define the styles of background layers, e.g. list(col="grey", cex=1, lwd=1, pch=16, lty=1)

scaleBar.pos

A 2-D coordinate or character to define the position of scale bar, i.e. "topright", "topleft", "bottomright", "bottomleft"

mtitle

Title of each map

htitle

Title of each histogram

legend

Title of each legend for each map

legend.pos

A 2-D coordinate or character to define the position of legend, i.e. "topright", "topleft", "bottomright", "bottomleft"

cuts

The number of classes.

cutter

Function used to create the break points. Can be user defined or a supplied cut function.

horiz

logical; if TRUE, set the legend horizontally rather than vertically

digits

Number of digits kept for legend

...

Arguments to be passed to methods

Details

The function returns no value, but draws thematic maps together with histograms on the current graphics device as a side effect.

Value

None (see above).

Author(s)

Binbin Lu

See Also

choropleth, choro.legend, auto.shading, shading.

Examples

data(newhaven)
# Single map
thematic.map(blocks, var.names="POP1990", horiz = FALSE, na.pos = "topleft", 
            scaleBar.pos = "bottomright", legend.pos = "bottomleft",
            colorStyle = "red")

#Multiple maps and different colors
thematic.map(blocks, var.names=c("P_35_44","P_25_34", "POP1990"), 
horiz =FALSE, na.pos = "topleft", scaleBar.pos = "bottomright", 

legend.pos = "bottomleft",colorStyle =hcl.colors)
thematic.map(blocks, var.names=c("P_35_44","P_25_34", "POP1990"), 

horiz =FALSE, na.pos = "topleft", scaleBar.pos = "bottomright",
 legend.pos = "bottomleft", colorStyle =c("red", "blue", "na"))
# Use coordinate to define the legend
data(WHData)
thematic.map(whp_sp, var.names="Avg_Green_", colorStyle ="red",
             na.pos = "topleft", scaleBar.pos = "bottomleft", 
             legend.pos = c(544000, 3380000),cuts=7, 
             cutter=rangeCuts)
thematic.map(WHHP, var.names=c("Avg_HP_avg", "Avg_Green_"), colorStyle =c("red", "blue"),
             na.pos = "topleft", scaleBar.pos = "bottomleft", 
             legend.pos = c(544000, 3380000),cuts=7, 
             cutter=rangeCuts)

GISTools documentation built on Oct. 3, 2024, 1:08 a.m.