Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/r-tmap/tmap
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Jun 10, 2024
2 parents 2d69bf5 + 4740101 commit 84a1b53
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 63 deletions.
6 changes: 0 additions & 6 deletions R/tm_element.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -77,11 +76,6 @@ replace_last_tmap_by_correct_call = function(mc, lt) {
}
}






#' Print tm_element
#'
#' @param x x
Expand Down
3 changes: 0 additions & 3 deletions R/tm_layers_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions R/tm_layers_symbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
33 changes: 16 additions & 17 deletions R/tm_legend.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"))
}

2 changes: 0 additions & 2 deletions R/tm_pos.R
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
9 changes: 3 additions & 6 deletions R/tm_scale_.R
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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`).
Expand Down
1 change: 1 addition & 0 deletions R/tm_scale_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/tmap_animation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/tmap_arrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions R/tmap_leaflet.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, ...)
}
4 changes: 0 additions & 4 deletions R/tmap_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -1245,10 +1245,6 @@ tmapAddLayerOptions = function(option, id, value) {
tmap_options(o2)
}





#' @rdname tmap_options
#' @export
tmap_options_diff <- function() {
Expand Down
32 changes: 16 additions & 16 deletions man/tm_legend.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_scale.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/tm_scale_bivariate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_scale_categorical.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_scale_intervals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 84a1b53

Please sign in to comment.