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
1
vote
0 answers

How to change the transparency of shapefile in tmap_leaflet

I am using tmap_leaflet function to make a map and I like the result, however, I would like to slightly change the transparency of the shapefile such that I am able to see a bit of the tiles google street map underneath. This is the code I used: I…
Ani
  • 328
  • 1
  • 4
  • 13
1
vote
1 answer

Error in tmap projection: invalid crs: hd

When I try to draw a map with a Hobo–Dyer projection, it told me: Error in st_crs.character(x[[shape.id[masterID]]]$projection) : invalid crs: hd Here is my code: tm_shape(countries_spdf, projection = "hd") + tm_grid(n.x = 11, n.y = 11) + …
Yuhan Wang
  • 11
  • 1
1
vote
1 answer

How to get the sum of values of a column in tmap?

I have 2 columns - Matches(Integer), Accounts_type(String). And i want to create a third column where i want to get proportions of matches played by different account types. I am new to Talend & am facing issue with this for past 2 days & did a lot…
Raghunandan
  • 87
  • 1
  • 10
1
vote
0 answers

Cannot install tmap

When I try to install tmap: install.packages("tmap") I have the following mistake: also installing the dependencies ‘tmaptools’, ‘sf’ There are binary versions available but the source versions are later: binary source needs_compilation sf…
marinetheo
  • 11
  • 2
1
vote
1 answer

Plotting dots layer using tmap over "World" basemap

I am working on geospatial data : place_name id region_country x y 1 Barcelona 10102 Spain 41.4 2.18 2 Bilbao 10103 Spain 43.2 -2.97 3 Cadiz …
Wilcar
  • 2,349
  • 2
  • 21
  • 48
1
vote
1 answer

R - tmap: Add thick border and transform counties with NAs to diagonal stripes

I am trying to recreate the following maps in R using tmap: First Map: Second Map: My questions are: How to transform the counties with NAs from grey (which I think is the default in tmap) to diagonal stripes that is shown in the first map? How…
celilati
  • 153
  • 7
1
vote
0 answers

R multiple layers in leaflet (using tmap)

I want to create a map using the library tmap (to save loads of bother with shapefiles). Then I convert into leaflet, with a drop down menu to select which data I want to show. In the example below, I wish for a select option to show either HPI and…
SLE
  • 65
  • 1
  • 17
1
vote
1 answer

tm_bubbles from tmap disorganizes names when handling NAs

everyone. This is my first post. I am making a map of Ecuador showing the number of coronavirus confirmed cases by Province. This is the data I prepared. It has the province names and cases as for today. It has some NAs because not all provinces…
1
vote
1 answer

Smoothing map with elevation levels; R with tmap

I am creating a map for a scientific manuscript. The map should show a basic map of Mexico, with the sampling sites and display elevation level colours. For this, I am using R with the package tmap. This is my code:…
1
vote
1 answer

One legend with same scale tmap

I want to make a graph by combining several maps, as shown in the attached image. But I need to create one legend (not four as shown) and also want to vary between 0 to 100. I think it is possible, any suggestion in this regard would be great.…
S. Ahmad
  • 39
  • 6
1
vote
0 answers

How to specify labels on the sides of a multi-panel layout in tmap?

I have a 4-panel map for which I would like to have one set of horizontal labels at the top (which would not be repeated) and one set of vertical labels on the sides (which would not be repeated). When a multiple-panel map is created based on values…
user3386170
  • 276
  • 4
  • 22
1
vote
1 answer

How do I fix this missing variable problem in ggplot when tmap works fine?

I have a large spatial data frame, head information here: class : SpatialPolygonsDataFrame features : 6 extent : 1268821, 1610480, 4828587, 5485976 (xmin, xmax, ymin, ymax) crs : +proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996…
Michelle
  • 1,281
  • 2
  • 16
  • 31
1
vote
0 answers

Popup on tmap leaflet with clickable link

I would like to make a map of point locations using a tmap leaflet that when you click on a location it brings up a popup that includes a clickable link. Is there a way to do this? Here is some sample code of what I would like to…
user3004015
  • 617
  • 1
  • 7
  • 14
1
vote
1 answer

R sf st-intersection keep unmatched rows

I'm trying to create a map that shows the coverage of proprietary data (shapefile). Basically, the outcome will show how much of the contiguous USA is covered by the data. I used st_intersection, but it only keeps "matched" rows. Is there a way I…
qnp1521
  • 806
  • 6
  • 20
1
vote
1 answer

tmap tm_add_legend alpha doesn't work for "fill"

I'm trying to change the alpha value of my legend to match that of the polygon fill, however nothing seems to happen when I specify the alpha argument in tm_add_legend. Is there something blindingly obvious that i'm missing…
geo_rkal
  • 43
  • 4