tmap-element that draw spatial lines.tm_lines(col = NA, lwd = 1, lty = "solid", alpha = NA, scale = 1,
  lwd.legend = NULL, lwd.legend.labels = NULL, n = 5,
  style = ifelse(is.null(breaks), "pretty", "fixed"), breaks = NULL,
  interval.closure = "left", palette = NULL, labels = NULL,
  auto.palette.mapping = TRUE, contrast = NA, max.categories = 12,
  colorNA = NA, textNA = "Missing", showNA = NA, title.col = NA,
  title.lwd = NA, legend.col.show = TRUE, legend.lwd.show = TRUE,
  legend.format = list(), 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, id = NA, popup.vars = NA, popup.format = list())style) will get the line width defined by scale. If multiple values are specified, small multiples are drawn (see details).col is used (normally 1).lwd.legend.lwd is the name of a numeric variable.col is a numeric variable. Discrete options are "cat", "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", and "jenks". A numeric variable is processed as a categorial variable when using "cat", i.e. each unique value will correspond to a distinct category. For the other discrete options, see the details in classIntervals. Continuous options are "cont" and "order". The former maps the values of col to a smooth gradient, whereas the latter maps the order of values of col to a smooth gradient. They are the continuous variants of respectively the discrete methods "equal" and quantile".style=="fixed", breaks should be specified. The breaks argument can also be used when style="cont". In that case, the breaks are mapped evenly to the sequential or divering color palette."left" or "right". Only applicable if col is a numerc variable.tmaptools::palette_explorer() for the named palettes. Use a "-" as prefix to reverse the palette. The default palette is taken from tm_layout's argument aes.palette, which typically depends on the style. The type of palette from aes.palette is automatically determined, but can be overwritten: use "seq" for sequential, "div" for diverging, and "cat" for categorical.auto.palette.mapping=TRUE). Both numbers should be between 0 and 1. The first number determines where the palette begins, and the second number where it ends. For sequential palettes, 0 means the brightest color, and 1 the darkest color. For diverging palettes, 0 means the middle color, and 1 both extremes. If only one number is provided, this number is interpreted as the endpoint (with 0 taken as the start).col 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 and auto.palette.mapping is FALSE, then levels are combined.NULL for transparency.NA), this depends on the presence of missing values.labels is undefined. Parameters are:
scientific, format, and digits (see below) are not used.format of the numbers is "g". Otherwise, format="f", and text.separator, text.less.than, and text.or.more are used. Also, the numbers are automatically  rounded to millions or billions if applicable."f", i.e. the standard notation xxx.xxx, is used. If scientific=TRUE then "g", which means that numbers are formatted scientically, i.e. n.dddE+nn if needed to save space.format="f", and the number of significant digits otherwise.formatCTRUE) or landscape (FALSE)TRUE) or landscape (FALSE)legend.col.z)legend.col.z)"view" mode (see tmap_mode)."view" mode. If NA (default), only aesthetic variables (i.e. specified by col and lwd) are shown). If they are not specified, all variables are shown. Set popup.vars to FALSE to disable popups. When a vector of variable names is provided, the names (if specified) are printed in the popups.legend.format for options. Only applicable for numeric data variables. If one list of formatting options is provided, it is applied to all numeric variables of popup.vars. Also, a (named) list of lists can be provided. In that case, each list of formatting options is applied to the named variable.tmap-elementby argument in tm_facets, or by defining multiple variables in the aesthetic arguments. The aesthetic arguments of tm_lines are col and lwd. In the latter case, the arguments, except for the ones starting with legend., can be specified for small multiples as follows. If the argument normally only takes a single value, such as n, then a vector of those values can be specified, one for each small multiple. If the argument normally can take a vector, such as palette, then a list of those vectors (or values) can be specified, one for each small multiple.data(World, Europe, rivers)
qtm(rivers)
## Not run: ------------------------------------
# tm_shape(Europe) +
#     tm_fill() +
# tm_shape(rivers) +
#     tm_lines(col="black", lwd="scalerank", scale=2, legend.lwd.show = FALSE) +
# tm_layout("Rivers of Europe") +
# tm_style_cobalt()
## ---------------------------------------------
Run the code above in your browser using DataLab