chilemapas is back on CRAN

[This article was first published on https://pacha.dev/blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Before the main content: I am creating an R Community on Google Groups. You can join the group using this form.

I recently lost access to my old uni email, and so I never knew I had to fix a few things about the Spanish documentation for chilemapas. As a result, it was removed from CRAN and now it’s back. This package is now seven years old!

Here is how to create a map with a gradients reflecting the number of letters for each region name.

if (!require(chilemapas)) install.packages("chilemapas", repos = "https://cran.r-project.org")
if (!require(tmap)) install.packages("tmap", repos = "https://cran.r-project.org")

library(chilemapas)
library(tmap)

chile_regions <- generar_regiones()

chile_regions_names <- codigos_territoriales[, c("codigo_region", "nombre_region")]
chile_regions_names <- unique(chile_regions_names)
chile_regions_names$letters <- nchar(chile_regions_names$nombre_region)

chile_regions <- merge(chile_regions, chile_regions_names)

dev("chile.png")

m <- tm_shape(chile_regions) +
    tm_polygons(fill = "letters")

tmap_save(m, "chile.png", height = 7)

Chile

For the next release I will work on simplified dependencies, this release “just works”.

Note: Antartic territories are excluded and under no event these maps mean there is a cession or occupation of sovereign territories against International Laws from Chile.

To leave a comment for the author, please follow the link and comment on their blog: https://pacha.dev/blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)