diff --git a/R/tm_element.R b/R/tm_element.R index a5442869..540f0885 100644 --- a/R/tm_element.R +++ b/R/tm_element.R @@ -62,7 +62,6 @@ save_last_map = function() { assign("last_map_new", NULL, envir = .TMAP) } - replace_last_tmap_by_correct_call = function(mc, lt) { if (is.symbol(mc)) { mc @@ -77,11 +76,6 @@ replace_last_tmap_by_correct_call = function(mc, lt) { } } - - - - - #' Print tm_element #' #' @param x x diff --git a/R/tm_layers_sf.R b/R/tm_layers_sf.R index 9695943a..b575faa2 100644 --- a/R/tm_layers_sf.R +++ b/R/tm_layers_sf.R @@ -19,9 +19,6 @@ opt_tm_sf = function(polygons.only = "yes", } - - - #' Map layer: simple features #' #' Map layer that draws simple features as they are. Supported visual variables diff --git a/R/tm_layers_symbols.R b/R/tm_layers_symbols.R index f5ee7092..bed11dbf 100644 --- a/R/tm_layers_symbols.R +++ b/R/tm_layers_symbols.R @@ -26,8 +26,6 @@ opt_tm_bubbles = opt_tm_symbols #' @export opt_tm_squares = opt_tm_symbols - - #' Map layer: symbols #' #' Map layer that draws symbols Supported visual variables are: diff --git a/R/tm_legend.R b/R/tm_legend.R index 81d4ae45..a89587aa 100644 --- a/R/tm_legend.R +++ b/R/tm_legend.R @@ -2,34 +2,34 @@ #' #' Legend specification #' -#' @param title PARAM_DESCRIPTION -#' @param show PARAM_DESCRIPTION -#' @param orientation PARAM_DESCRIPTION +#' @param title Legend title +#' @param show Show legend? +#' @param orientation Orientation of the legend: `"portrait"` or `"landscape"` #' @param design PARAM_DESCRIPTION -#' @param reverse PARAM_DESCRIPTION +#' @param reverse Should the legend be reversed? #' @param na.show PARAM_DESCRIPTION #' @param position PARAM_DESCRIPTION -#' @param width PARAM_DESCRIPTION -#' @param height PARAM_DESCRIPTION +#' @param width Width of the legend +#' @param height Height of the legend #' @param stack PARAM_DESCRIPTION #' @param z PARAM_DESCRIPTION #' @param group.frame PARAM_DESCRIPTION #' @param resize.as.group PARAM_DESCRIPTION -#' @param title.color PARAM_DESCRIPTION -#' @param title.size PARAM_DESCRIPTION -#' @param title.fontface PARAM_DESCRIPTION -#' @param title.fontfamily PARAM_DESCRIPTION +#' @param title.color Color of the legend title +#' @param title.size Size of the legend title +#' @param title.fontface Font face of the legend title +#' @param title.fontfamily Font family of the legend title #' @param title.padding PARAM_DESCRIPTION -#' @param text.color PARAM_DESCRIPTION -#' @param text.size PARAM_DESCRIPTION -#' @param text.fontface PARAM_DESCRIPTION -#' @param text.fontfamily PARAM_DESCRIPTION +#' @param text.color Color of the legend text +#' @param text.size Size of the legend text +#' @param text.fontface Font face of the legend text +#' @param text.fontfamily Font family of the legend text #' @param format PARAM_DESCRIPTION #' @param frame PARAM_DESCRIPTION #' @param frame.lwd PARAM_DESCRIPTION #' @param frame.r PARAM_DESCRIPTION -#' @param bg.color PARAM_DESCRIPTION -#' @param bg.alpha PARAM_DESCRIPTION +#' @param bg.color Background color of the legend +#' @param bg.alpha Background transparency of the legend #' @param item.height PARAM_DESCRIPTION #' @param item.width PARAM_DESCRIPTION #' @param item.space PARAM_DESCRIPTION @@ -138,4 +138,3 @@ tm_legend_bivariate = function(xlab, if (!("z" %in% (names(args)))) args$z = as.integer(NA) structure(args, class = c("tm_legend", "tm_component", "list")) } - diff --git a/R/tm_pos.R b/R/tm_pos.R index 0ed2bde4..9a27c944 100644 --- a/R/tm_pos.R +++ b/R/tm_pos.R @@ -151,12 +151,10 @@ tm_pos_auto_in = function(align.h, align.v, just.h, just.v) { structure(args, class = "tm_pos") } - str2pos = function(x) { tm_pos_in(x[1], x[2]) } - num2pos = function(x) { tm_pos_in(x[1], x[2]) } diff --git a/R/tm_scale_.R b/R/tm_scale_.R index 51541e0c..ab4b1d70 100644 --- a/R/tm_scale_.R +++ b/R/tm_scale_.R @@ -30,7 +30,7 @@ tm_shape_vars = function() { #' [tm_scale_intervals()], [tm_scale_discrete()], [tm_scale_continuous()], #' [tm_scale_rank()], [tm_scale_continuous_log()], [tm_scale_continuous_log2()], #' [tm_scale_continuous_log10()], [tm_scale_continuous_log1p()], [tm_scale_continuous_sqrt()], -#' [tm_scale_continuous_pseudo_log()], [tm_scale_rgb()] +#' [tm_scale_continuous_pseudo_log()], [tm_scale_rgb()], [tm_scale_bivariate()] #' @export tm_scale = function(...) { # maybe add the generic scales parameters after ... here? @@ -54,7 +54,6 @@ tm_scale_asis = function(values.scale = NA, value.neutral = NA, ...) { } #' @export -#' @name tm_scale_ordinal #' @rdname tm_scale_categorical tm_scale_ordinal = function(n.max = 30, values = NA, # e.g. palette, shape numbers, set of sizes (if two values are specified they are interpret as range) @@ -78,7 +77,7 @@ tm_scale_ordinal = function(n.max = 30, #' Scales in tmap are configured by the family of functions with prefix `tm_scale`. #' Such function should be used for the input of the `.scale` arguments in the #' layer functions (e.g. `fill.scale` in [tm_polygons()]). -#' The functions [tm_scale_categorical()] and [tm_scale_ordinal()] are used +#' The functions `tm_scale_categorical()` and `tm_scale_ordinal()` are used #' for categorical data. The only difference between these functions is that the #' former assumes unordered categories whereas the latter assumes ordered categories. #' For colors (the visual variable `fill` or `col`), different default color @@ -100,8 +99,6 @@ tm_scale_ordinal = function(n.max = 30, #' @param label.format (generic scale argument) Label formatting (similar to `legend.format` in tmap3) #' @seealso [tm_scale()] #' @export -#' @name tm_scale_categorical -#' @rdname tm_scale_categorical tm_scale_categorical = function(n.max = 30, values = NA, # e.g. palette, shape numbers, set of sizes (if two values are specified they are interpret as range) values.repeat = TRUE, @@ -124,7 +121,7 @@ tm_scale_categorical = function(n.max = 30, #' Scales in tmap are configured by the family of functions with prefix `tm_scale`. #' Such function should be used for the input of the `.scale` arguments in the #' layer functions (e.g. `fill.scale` in [tm_polygons()]). -#' The function [tm_scale_interval()] is used for numerical data. +#' The function `tm_scale_intervals()` is used for numerical data. #' #' @param n Number of intervals. For some styles (see argument `style` below) it is the preferred number rather than the exact number. #' @param style Method to create intervals. Options are `"cat"`, `"fixed"`, `"sd"`, `"equal"`, `"pretty"`, `"quantile"`, `"kmeans"`, `"hclust"`, `"bclust"`, `"fisher"`, `"jenks"`, `"dpih"`, `"headtails"`, and `"log10_pretty"`. See the details in [classInt::classIntervals()] (extra arguments can be passed on via `style.args`). diff --git a/R/tm_scale_bivariate.R b/R/tm_scale_bivariate.R index 0d84dfb6..cd9d4ded 100644 --- a/R/tm_scale_bivariate.R +++ b/R/tm_scale_bivariate.R @@ -16,6 +16,7 @@ #' @param labels (generic scale argument) Labels #' @param label.na (generic scale argument) Label for missing values #' @param label.null (generic scale argument) Label for null (out-of-scope) values +#' @seealso [tm_scale()] #' @export #' @name tm_scale_bivariate #' @rdname tm_scale_bivariate diff --git a/R/tmap_animation.R b/R/tmap_animation.R index 5034acac..f7fdfb70 100644 --- a/R/tmap_animation.R +++ b/R/tmap_animation.R @@ -37,7 +37,7 @@ #' @import tmaptools #' @importFrom utils browseURL #' @export -tmap_animation <- function(tm, filename = NULL, width = NA, height = NA, dpi = NA, delay = 40, fps = NA, loop = TRUE, outer.margins=NA, asp=NULL, scale=NA, restart.delay = NULL, ...) { +tmap_animation <- function(tm, filename = NULL, width = NA, height = NA, dpi = NA, delay = 40, fps = NA, loop = TRUE, outer.margins = NA, asp = NULL, scale = NA, restart.delay = NULL, ...) { .tmapOptions <- get("tmapOptions", envir = .TMAP) showAni = missing(filename) diff --git a/R/tmap_arrange.R b/R/tmap_arrange.R index 589b54ae..e842cce3 100644 --- a/R/tmap_arrange.R +++ b/R/tmap_arrange.R @@ -33,7 +33,7 @@ #' @param options options passed on to [knitr::knit_print()] #' @example ./examples/tmap_arrange.R #' @export -tmap_arrange <- function(..., ncol=NA, nrow=NA, widths=NA, heights = NA, sync=FALSE, asp=0, outer.margins=.02) { +tmap_arrange <- function(..., ncol = NA, nrow = NA, widths = NA, heights = NA, sync = FALSE, asp = 0, outer.margins = .02) { tms <- list(...) if (!inherits(tms[[1]], "tmap")) { if (!is.list(tms[[1]])) stop("The first argument of tmap_arrange is neither a tmap object nor a list.") diff --git a/R/tmap_leaflet.R b/R/tmap_leaflet.R index 4929c734..fef116f9 100644 --- a/R/tmap_leaflet.R +++ b/R/tmap_leaflet.R @@ -25,7 +25,7 @@ tmap_leaflet = function(x, options(tmap.mode = current_mode) }) options(tmap.mode = "view") - print.tmap(x, show=show, ...) + print.tmap(x, show = show, ...) } #' @name tmap_grid @@ -39,5 +39,5 @@ tmap_grid = function(x, options(tmap.mode = current_mode) }) options(tmap.mode = "plot") - print.tmap(x, show=show, ...) + print.tmap(x, show = show, ...) } diff --git a/R/tmap_options.R b/R/tmap_options.R index b053701f..6d063eb1 100644 --- a/R/tmap_options.R +++ b/R/tmap_options.R @@ -1245,10 +1245,6 @@ tmapAddLayerOptions = function(option, id, value) { tmap_options(o2) } - - - - #' @rdname tmap_options #' @export tmap_options_diff <- function() { diff --git a/man/tm_legend.Rd b/man/tm_legend.Rd index c43674f2..ee6146ec 100644 --- a/man/tm_legend.Rd +++ b/man/tm_legend.Rd @@ -57,23 +57,23 @@ tm_legend_hide() tm_legend_combine(variable) } \arguments{ -\item{title}{PARAM_DESCRIPTION} +\item{title}{Legend title} -\item{show}{PARAM_DESCRIPTION} +\item{show}{Show legend?} -\item{orientation}{PARAM_DESCRIPTION} +\item{orientation}{Orientation of the legend: \code{"portrait"} or \code{"landscape"}} \item{design}{PARAM_DESCRIPTION} -\item{reverse}{PARAM_DESCRIPTION} +\item{reverse}{Should the legend be reversed?} \item{na.show}{PARAM_DESCRIPTION} \item{position}{PARAM_DESCRIPTION} -\item{width}{PARAM_DESCRIPTION} +\item{width}{Width of the legend} -\item{height}{PARAM_DESCRIPTION} +\item{height}{Height of the legend} \item{stack}{PARAM_DESCRIPTION} @@ -83,23 +83,23 @@ tm_legend_combine(variable) \item{resize.as.group}{PARAM_DESCRIPTION} -\item{title.color}{PARAM_DESCRIPTION} +\item{title.color}{Color of the legend title} -\item{title.size}{PARAM_DESCRIPTION} +\item{title.size}{Size of the legend title} -\item{title.fontface}{PARAM_DESCRIPTION} +\item{title.fontface}{Font face of the legend title} -\item{title.fontfamily}{PARAM_DESCRIPTION} +\item{title.fontfamily}{Font family of the legend title} \item{title.padding}{PARAM_DESCRIPTION} -\item{text.color}{PARAM_DESCRIPTION} +\item{text.color}{Color of the legend text} -\item{text.size}{PARAM_DESCRIPTION} +\item{text.size}{Size of the legend text} -\item{text.fontface}{PARAM_DESCRIPTION} +\item{text.fontface}{Font face of the legend text} -\item{text.fontfamily}{PARAM_DESCRIPTION} +\item{text.fontfamily}{Font family of the legend text} \item{format}{PARAM_DESCRIPTION} @@ -109,9 +109,9 @@ tm_legend_combine(variable) \item{frame.r}{PARAM_DESCRIPTION} -\item{bg.color}{PARAM_DESCRIPTION} +\item{bg.color}{Background color of the legend} -\item{bg.alpha}{PARAM_DESCRIPTION} +\item{bg.alpha}{Background transparency of the legend} \item{item.height}{PARAM_DESCRIPTION} diff --git a/man/tm_scale.Rd b/man/tm_scale.Rd index 06a15458..0b79ab98 100644 --- a/man/tm_scale.Rd +++ b/man/tm_scale.Rd @@ -22,5 +22,5 @@ which scale is applied when. \code{\link[=tm_scale_intervals]{tm_scale_intervals()}}, \code{\link[=tm_scale_discrete]{tm_scale_discrete()}}, \code{\link[=tm_scale_continuous]{tm_scale_continuous()}}, \code{\link[=tm_scale_rank]{tm_scale_rank()}}, \code{\link[=tm_scale_continuous_log]{tm_scale_continuous_log()}}, \code{\link[=tm_scale_continuous_log2]{tm_scale_continuous_log2()}}, \code{\link[=tm_scale_continuous_log10]{tm_scale_continuous_log10()}}, \code{\link[=tm_scale_continuous_log1p]{tm_scale_continuous_log1p()}}, \code{\link[=tm_scale_continuous_sqrt]{tm_scale_continuous_sqrt()}}, -\code{\link[=tm_scale_continuous_pseudo_log]{tm_scale_continuous_pseudo_log()}}, \code{\link[=tm_scale_rgb]{tm_scale_rgb()}} +\code{\link[=tm_scale_continuous_pseudo_log]{tm_scale_continuous_pseudo_log()}}, \code{\link[=tm_scale_rgb]{tm_scale_rgb()}}, \code{\link[=tm_scale_bivariate]{tm_scale_bivariate()}} } diff --git a/man/tm_scale_bivariate.Rd b/man/tm_scale_bivariate.Rd index db9663af..509bdb4c 100644 --- a/man/tm_scale_bivariate.Rd +++ b/man/tm_scale_bivariate.Rd @@ -48,3 +48,6 @@ Such function should be used for the input of the \code{.scale} arguments in the layer functions (e.g. \code{fill.scale} in \code{\link[=tm_polygons]{tm_polygons()}}). The function \code{tm_scale_bivariate()} is used for \code{bivariate.scales}. } +\seealso{ +\code{\link[=tm_scale]{tm_scale()}} +} diff --git a/man/tm_scale_categorical.Rd b/man/tm_scale_categorical.Rd index 9cdf7fb0..74caf7a4 100644 --- a/man/tm_scale_categorical.Rd +++ b/man/tm_scale_categorical.Rd @@ -72,7 +72,7 @@ tm_scale_categorical( Scales in tmap are configured by the family of functions with prefix \code{tm_scale}. Such function should be used for the input of the \code{.scale} arguments in the layer functions (e.g. \code{fill.scale} in \code{\link[=tm_polygons]{tm_polygons()}}). -The functions \code{\link[=tm_scale_categorical]{tm_scale_categorical()}} and \code{\link[=tm_scale_ordinal]{tm_scale_ordinal()}} are used +The functions \code{tm_scale_categorical()} and \code{tm_scale_ordinal()} are used for categorical data. The only difference between these functions is that the former assumes unordered categories whereas the latter assumes ordered categories. For colors (the visual variable \code{fill} or \code{col}), different default color diff --git a/man/tm_scale_intervals.Rd b/man/tm_scale_intervals.Rd index 7b0678c3..c1f9919d 100644 --- a/man/tm_scale_intervals.Rd +++ b/man/tm_scale_intervals.Rd @@ -66,7 +66,7 @@ tm_scale_intervals( Scales in tmap are configured by the family of functions with prefix \code{tm_scale}. Such function should be used for the input of the \code{.scale} arguments in the layer functions (e.g. \code{fill.scale} in \code{\link[=tm_polygons]{tm_polygons()}}). -The function \code{\link[=tm_scale_interval]{tm_scale_interval()}} is used for numerical data. +The function \code{tm_scale_intervals()} is used for numerical data. } \seealso{ \code{\link[=tm_scale]{tm_scale()}}