Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error messages + add example for tm_legend #997

Merged
merged 5 commits into from
Dec 19, 2024
Merged

Conversation

olivroy
Copy link
Contributor

@olivroy olivroy commented Dec 18, 2024

No description provided.

structure(FALSE, info = {if (is_var) " Variable should be a data variable name or a symbol (see tm_symbols - details section)." else " Values should be symbols (see tm_symbols - details section)."})
structure(FALSE, info = {if (is_var) " Variable should be a data variable name or a symbol (see {.help [tm_symbols](tmap::tm_symbols)} - details section)." else " Values should be symbols (see {.help [tm_symbols](tmap::tm_symbols)} - details section)."})
Copy link
Contributor Author

@olivroy olivroy Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #996 (comment) This ends up giving this error message (i know it is incorrect in this very case, but a good improvement in general)

library(tmap)
metroAfrica = sf::st_intersection(metro, World[World$continent == "Africa", ])
#> Warning: attribute variables are assumed to be spatially constant throughout
#> all geometries
my_icons = rep("https://leafletjs.com/examples/custom-icons/leaf-green.png", 5)

# worked in the book
tm_shape(metroAfrica) +
    tm_symbols(shape = "income_grp",
               shapes = my_icons)

image

vignettes/01_basics_vv.Rmd Outdated Show resolved Hide resolved
@mtennekes
Copy link
Member

Seeing this now, sorry: already fixed and rewrote the vignette (7621534).

Could you remove that part of this PR?

@olivroy olivroy changed the title Fix vignette + improve error messages + add example for tm_legend improve error messages + add example for tm_legend Dec 18, 2024
@mtennekes mtennekes merged commit 7a42042 into master Dec 19, 2024
3 of 9 checks passed
@olivroy olivroy deleted the fix-vig branch December 19, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants