Questions tagged [tmap]

tmap is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on the Layered Grammar of Graphics, and resembles the syntax of ggplot2, a popular R-library for drawing charts.

tmap is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on A Layered Grammar of Graphics by Hadley Wickham and resembles the syntax of , a popular R-library for drawing charts.

Repositories

Vignette

Presentation

Other resources

487 questions
0
votes
1 answer

Change legend bin size in leaflet

I created a density map but R has chosen bin sizes that are too wide. I want to create my own bin sizes. https://i.stack.imgur.com/p49qc.jpg The image shows bin sizes at a full integer and it does not produce anything meaningful. I also cannot get…
Jacky
  • 710
  • 2
  • 8
  • 27
0
votes
1 answer

How to get multi-variable facets using tmap for raster maps (tm_raster() +tm_facets())

I would like to create a faceted map using my raster data using the tmap package. The end result will be multiple raster maps showing "values", with rows showing "class1" maps and columns showing "class2" maps as shown in the example figure…
zarrar
  • 47
  • 7
0
votes
1 answer

tmap:: faceted animated map: How to suppress title when custom label given

I have created an animated faceted map using tmap:: tm_facets along with custom panel labels. How do I avoid that the argument that is used to facet is shown as additional title? I only want the custom label in the panel. Minimum example:…
Kanoet
  • 143
  • 1
  • 11
0
votes
2 answers

After intersecting two shapefiles: `Error in vapply(g2, st_is_empty, logical(1))`

I run the following: library(dplyr) library(sf) library(tigris) library(tmap) options(tigris_class = 'sf') options(tigris_use_cache = TRUE) nj = tigris::states(cb = T, year = 2015) %>% filter(STUSPS == 'NJ') nj_msas =…
ardaar
  • 1,164
  • 9
  • 19
0
votes
1 answer

How can I resolve this error when installing r packages?

I want to try this geopspatial mapping tutorial but I can't get the tmap or tmaptools packages to install/load properly. Here are some screenshots of the installation. and and results in this problem when I try to load the libraries If anyone…
ACH
  • 339
  • 1
  • 2
  • 12
0
votes
1 answer

Merge neighbouring areas together, if tm_fill for one area is too small

I have made a map with zip codes of a town. The fill is the ratio of being a case or not case. But some zip codes have very few numbers in total so outliers distort the map. Is there a way to merge the polygons and data of two neighboring areas…
Schillerlocke
  • 305
  • 1
  • 14
0
votes
1 answer

Make map of number of crime in UK using tmap

I am making a map by tmap in R by combining the data using the area code. Not all the crime data is available. After I combining the data of the area and the crime data, I cannot plot the map uk_la1 <- readOGR(dsn = "./infuse_dist_lyr_2011", layer =…
Florence
  • 7
  • 1
0
votes
1 answer

In R tmap, how do I add layers to legend in interactive mode?

Starting with a toy example I can quickly get an interactive map in tmap with the following code: library(tmap) tmap_mode("view") data("World", "metro") tm_shape(World) + tm_polygons('life_exp', legend.show = TRUE) + …
radek
  • 7,240
  • 8
  • 58
  • 83
0
votes
0 answers

Increase space between axis titles and axis using tmap in R

I'm having an issue with finding answers for a fairly simple question. I just need to move the axis titles (xlab and ylab) away from the axes. I haven't uploaded reproducible data since the files are large shapefiles, but I can upload it if needed…
TheSciGuy
  • 1,154
  • 11
  • 22
0
votes
1 answer

Talend- Empty string handling when parsing dates using tmap component

I have a job that loads a CSV into a MySQL table. The field I am paring to a date using the t-map component has empty strings for a few of the records. When parsing the string to date, I need to convert those empty strings to the current date.…
0
votes
1 answer

Trouble installing units package for use of tmap package

I am trying to use tmap and other mapping and spatial statistics packages. When I try to load the library for tmap, I get an error: library(tmap) Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : …
M. Walker
  • 21
  • 1
  • 4
0
votes
0 answers

Adding geography to tmap World data frame

I need to map data of South America and the Caribbean, including small geographies such as St. Vincent and the Grenadines. However, in the World data set with the tmap library these are not included. Using the included spatial data base of the…
Fred Smith
  • 1
  • 1
  • 1
0
votes
2 answers

How to get rid of enter in String

I have a problem in my tMap when I try to do some operations on my string. I have a csv that has Ad_Set_Name that in some rows has more lines in the cell. I use the following: row4.Ad_Set_Name.contains(" ") ?…
Mara M
  • 153
  • 1
  • 1
  • 10
0
votes
2 answers

Parent-Child relationship in Talend

Facing problem and out of ideas on figuring on how to implement parent-child relationship in Talend. Problem Statement: Having a feed file which has data in below format MemberCode|LastName|FirstName A|SHINE|MICHAEL B|SHINE|MICHELLE C|SHINE|ERIN…
Abhishek
  • 2,482
  • 1
  • 21
  • 32
0
votes
0 answers

Error in .pointsToMatrix(p1) : latitude < -90 when facet

I have 3 shapefiles: mapa - All national roads from Bahia, Brazil (lines) postos - All Police Stations on those roads (points) tab_sf - All accidents from 2017 and 2018 on those roads (points) I am creating a shiny app to visualize the aciddents…