Skip to content

Commit

Permalink
Merge pull request #995 from r-tmap/corrections
Browse files Browse the repository at this point in the history
fix messages
  • Loading branch information
mtennekes authored Dec 18, 2024
2 parents 4914dd0 + 4847511 commit 89f50e3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ message_webgl_checks = function(checks, checkif) {

message_qtm_empty = function() {
cli::cli_inform(
"{.field [qtm]} nothing to show. Either specify {.arg shp} or {.arg basemap}. Alternatively, switch to view mode with {.code tmap_mode(\"view\")}"
"{.field [qtm()]} nothing to show. Either specify {.arg shp} or {.arg basemap}. Alternatively, switch to view mode with {.code tmap_mode(\"view\")}"
)
}

message_layer_unused_args = function(layer_fun, args) {
cli::cli_inform(c(
"{.field [{layer_fun}]} Argument{ifelse(length(args)>1, 's', '')} {.arg {args}} unknown."
"{.field [{layer_fun}()]} Argument{ifelse(length(args)>1, 's', '')} {.arg {args}} unknown."
))
}
2 changes: 1 addition & 1 deletion R/tm_layers_lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ tm_lines = function(col = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_lines"))
unused = setdiff(names(args), c(v3_only("tm_lines"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ tm_polygons = function(fill = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_polygons"))
unused = setdiff(names(args), c(v3_only("tm_polygons"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ tm_raster = function(col = tm_vars(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_raster"))
unused = setdiff(names(args), c(v3_only("tm_raster"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_rgb.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ tm_rgb = function(col = tm_vars(n = 3, multivariate = TRUE),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_rgb"))
unused = setdiff(names(args), c(v3_only("tm_rgb"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_symbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ tm_symbols = function(size = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_symbols"))
unused = setdiff(names(args), c(v3_only("tm_symbols"), "called_from"))

if (length(unused)) {
layer_fun = if ("called_from" %in% names(args)) {
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ tm_text = function(text = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_text"))
unused = setdiff(names(args), c(v3_only("tm_text"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down

0 comments on commit 89f50e3

Please sign in to comment.