tmap-element that draw spatial lines.tm_lines(col = "red", lwd = 1, lty = "solid", alpha = NA, scale = 1,
n = 5, style = "pretty", breaks = NULL, palette = NULL,
labels = NULL, auto.palette.mapping = TRUE, contrast = 1,
max.categories = 12, colorNA = "grey65", textNA = "Missing",
text_separator = "to", text_less_than = "Less than",
text_or_more = "or more", title.col = NA, title.lwd = NA,
legend.col.is.portrait = TRUE, legend.lwd.is.portrait = FALSE,
legend.hist = FALSE, legend.hist.title = NA, legend.col.z = NA,
legend.lwd.z = NA, legend.hist.z = NA)col is used (normally 1).lwd is the name of a numeric variable.classIntervals. Only applicable when lwd is the name ofstyle=="fixed", breaks should be specifiedRColorBrewer::display.brewer.all) for the lines. Only when col is set to a variable.auto.palette.mapping=TRUE). Both numbers should be between 0 and 1. The first number determines where the palette begins, and tcol is the name of a categorical variable, this value determines how many categories (levels) it can have maximally. If the number of levels is higher than max.categories, then levels are combined.NA to omit text for missing values in the legendTRUE) or landscape (FALSE)TRUE) or landscape (FALSE)legend.col.z)legend.col.z)vignette("tmap-nutshell")}data(rivers)
data(World)
data(Europe)
tm_shape(World) +
tm_fill("darkolivegreen3") +
tm_shape(rivers) +
tm_lines(col="navy") +
tm_layout_World("Rivers of the World", inner.margins = c(0,0,.1,0))
tm_shape(Europe) +
tm_fill("darkolivegreen3") +
tm_borders("white") +
tm_shape(rivers) +
tm_lines(col="navy", lwd="scalerank", scale=2) +
tm_layout("Rivers of Europe", legend.show=FALSE)Run the code above in your browser using DataLab