r-tmap / tmap

R package for thematic maps
https://r-tmap.github.io/tmap
GNU General Public License v3.0
865 stars 121 forks source link

Question (tmap v4) margins and index messages #945

Closed silcordero closed 1 hour ago

silcordero commented 1 month ago

Hello everyone,

I'm trying to find a way to hide the margin and index messages that appear when I print a map created with tmap v3.999. I've checked the help resources for the beta version but couldn't find any information on suppressing these messages.

I'm working on an RMarkdown document to generate a PDF file, and I want to eliminate these messages. I've tried modifying the r-chunk options (i.e., message = FALSE, warning = FALSE), but it didn't work.

Although my issue is primarily aesthetic when I use tmap_arrange() to plot several maps side by side, the index and margin messages are printed in the document, resulting in about a page and a half of unnecessary text.

Any suggestion would be appreciated! Thanks!

SCS

mtennekes commented 2 weeks ago

Try

library(tmap)
tmap_options(show.messages = FALSE, show.warnings = FALSE)

Can you show us what messages it returns, and what the map looks like? This could be useful for us to find out whether these messages are useful at all.

silcordero commented 2 weeks ago

Hello,

Thank you for your reply.

This is the margin message I am getting. I appear before the plot is printed (if the chunk is visible, it prints between it and the plot).

image

However, I also noticed that it does not appear all the time.

This is the output map

image

My tmap version is 3.99.9001 My R version is 4.4.1 beta (2024-06-03 r86679 ucrt) -- "Race for Your Life" My RStudio version is 2024.09.0 "Cranberry Hibiscus."

mtennekes commented 2 weeks ago

Thx. These messages are development-related, and should have been removed now. Could you check the latest version from github?

Nowosad commented 1 hour ago

@silcordero please reopen the issue if the problem is still here