Skip to content

Commit

Permalink
fixed new bug in #872 example
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed May 5, 2024
1 parent 4100137 commit 997f04a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions R/messages_v4_v3.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ v3_title = function(fun) {
message("[v3->v4] ", fun, "(): use 'tm_title()' instead of the 'title' argument of '", fun, "'")
}

v3_main_title = function(fun) {
message("[v3->v4] ", fun, "(): use 'tm_title()' instead of the 'main.title' argument of '", fun, "'")
}

v3_convert2density = function(layer_fun) {
message(paste0("[v3->v4] ", layer_fun, "(): convert2density is deprecated: divide the variable values by the polygon areas manually (obtain the areas with 'sf::st_area()')"))
}
Expand Down
5 changes: 4 additions & 1 deletion R/tm_layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,11 @@ tm_layout = function(
title2 = if (!is.null(main.title)) {
main.title.args = args[substr(names(args), 1, 10) == "main.title"]
main.title.args$main.title = NULL
if ("main.title.position" %in% names(main.title.args)) {
main.title.args$main.title.position = tm_pos_out(main.title.args$main.title.position, "top")
}
names(main.title.args) = substr(names(main.title.args), 12, nchar(names(main.title.args)))
warning("The 'main.title' argument of 'tm_layout()' is deprecated as of tmap 4.0. Please use 'tm_title()' instead.", call. = FALSE)
v3_main_title(fun)
args$main.title = NULL
do.call(tm_title, c(list(text = main.title), main.title.args))
} else {
Expand Down

0 comments on commit 997f04a

Please sign in to comment.