diff --git a/R/tm_layers_symbols.R b/R/tm_layers_symbols.R index b599ed7f..b54a985b 100644 --- a/R/tm_layers_symbols.R +++ b/R/tm_layers_symbols.R @@ -616,3 +616,52 @@ tm_bubbles = function(size = tm_const(), tm[[1]]$layer = c("bubbles", "symbols") tm } + + +#' @export +#' @name tm_squares +#' @rdname tm_symbols +tm_squares = function(size = tm_const(), + size.scale = tm_scale(), + size.legend = tm_legend(), + size.free = NA, + fill = tm_const(), + fill.scale = tm_scale(), + fill.legend = tm_legend(), + fill.free = NA, + col = tm_const(), + col.scale = tm_scale(), + col.legend = tm_legend(), + col.free = NA, + lwd = tm_const(), + lwd.scale = tm_scale(), + lwd.legend = tm_legend(), + lwd.free = NA, + lty = tm_const(), + lty.scale = tm_scale(), + lty.legend = tm_legend(), + lty.free = NA, + fill_alpha = tm_const(), + fill_alpha.scale = tm_scale(), + fill_alpha.legend = tm_legend(), + fill_alpha.free = NA, + col_alpha = tm_const(), + col_alpha.scale = tm_scale(), + col_alpha.legend = tm_legend(), + col_alpha.free = NA, + plot.order = tm_plot_order("size"), + trans.args = list(points.only = "ifany"), + mapping.args = list(icon.scale = 3, + just = NA, + grob.dim = c(width=48, height=48, render.width=256, render.height=256)), + zindex = NA, + group = NA, + group.control = "check", + ...) { + + args = c(as.list(environment()), list(...)) + tm = do.call(tm_symbols, args) + tm[[1]]$layer = c("squares", "symbols") + tm +} + diff --git a/R/tmap_options.R b/R/tmap_options.R index d1f893eb..ded052b4 100644 --- a/R/tmap_options.R +++ b/R/tmap_options.R @@ -54,9 +54,11 @@ fontface = "plain", shape.symbols = 21, shape.bubbles = 21, + shape.squares = 22, shape.dots = 19, size.symbols = 1, size.bubbles = 1.3333, + size.squares = 1.3333, size.dots = .15, size.text = 1, fill_alpha = 1, @@ -136,7 +138,8 @@ 1, lwd.lines = 1, size.symbols = 1, - size.bubbles = 1.3333 + size.bubbles = 1.3333, + size.squares = 1.3333 ), # scales diff --git a/R/v4-not-implemented.R b/R/v4-not-implemented.R index 2cb818fe..ac0157f3 100644 --- a/R/v4-not-implemented.R +++ b/R/v4-not-implemented.R @@ -1,10 +1,3 @@ -#' These functions will be implemented soon -#' @export -#' @param ... Arguments -#' @name v4-not-yet -tm_squares <- function(...) { - stop("Not yet implemented in v4") -} #' @export #' @rdname v4-not-yet tm_iso <- function() { diff --git a/man/tm_symbols.Rd b/man/tm_symbols.Rd index 79c6cde1..44fdfa79 100644 --- a/man/tm_symbols.Rd +++ b/man/tm_symbols.Rd @@ -4,6 +4,7 @@ \alias{tm_symbols} \alias{tm_dots} \alias{tm_bubbles} +\alias{tm_squares} \title{Map layer: symbols} \usage{ tm_symbols( @@ -130,6 +131,45 @@ tm_bubbles( group.control = "check", ... ) + +tm_squares( + size = tm_const(), + size.scale = tm_scale(), + size.legend = tm_legend(), + size.free = NA, + fill = tm_const(), + fill.scale = tm_scale(), + fill.legend = tm_legend(), + fill.free = NA, + col = tm_const(), + col.scale = tm_scale(), + col.legend = tm_legend(), + col.free = NA, + lwd = tm_const(), + lwd.scale = tm_scale(), + lwd.legend = tm_legend(), + lwd.free = NA, + lty = tm_const(), + lty.scale = tm_scale(), + lty.legend = tm_legend(), + lty.free = NA, + fill_alpha = tm_const(), + fill_alpha.scale = tm_scale(), + fill_alpha.legend = tm_legend(), + fill_alpha.free = NA, + col_alpha = tm_const(), + col_alpha.scale = tm_scale(), + col_alpha.legend = tm_legend(), + col_alpha.free = NA, + plot.order = tm_plot_order("size"), + trans.args = list(points.only = "ifany"), + mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, + render.width = 256, render.height = 256)), + zindex = NA, + group = NA, + group.control = "check", + ... +) } \arguments{ \item{size, size.scale, size.legend, size.chart, size.free}{Visual variable that determines the size. See details.} diff --git a/man/v4-not-yet.Rd b/man/v4-not-yet.Rd deleted file mode 100644 index 8d01d2df..00000000 --- a/man/v4-not-yet.Rd +++ /dev/null @@ -1,54 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/v4-not-implemented.R -\name{v4-not-yet} -\alias{v4-not-yet} -\alias{tm_squares} -\alias{tm_iso} -\alias{tm_markers} -\alias{tm_logo} -\alias{tm_minimap} -\alias{tmap_grob} -\alias{tmapOutput} -\alias{tmapProxy} -\alias{renderTmap} -\alias{tm_remove_layer} -\alias{tm_rgba} -\alias{tmap_tip} -\alias{tmap_style_catalog} -\alias{tmap_style_catalogue} -\title{These functions will be implemented soon} -\usage{ -tm_squares(...) - -tm_iso() - -tm_markers() - -tm_logo(...) - -tm_minimap() - -tmap_grob(...) - -tmapOutput(...) - -tmapProxy(...) - -renderTmap(...) - -tm_remove_layer(...) - -tm_rgba(...) - -tmap_tip(...) - -tmap_style_catalog(...) - -tmap_style_catalogue(...) -} -\arguments{ -\item{...}{Arguments} -} -\description{ -These functions will be implemented soon -}