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
511
questions
1
vote
1
answer
35
views
Raster is drawn only partly in tmap
Some of my maps that contain rasters get drawn partly only. The southern part of the map is cut off. It looks like some memory limit, but I have no idea if it is so. Another option is something ...
0
votes
1
answer
52
views
Problem with deploying shiny app/leaflet to shinyapps.io
I am trying to deploy a very simple app to Shinyapps.io.
My app is the following, and the structure of the folder is mines_peru/app.R (the file below) and mines_peru/data/clean_active_mines.RDS.
...
0
votes
0
answers
7
views
Wrong tm_scale_bar when plotting osm raster (tmaptools)
I can't manage to plot osm-tiles created with tmaptools::read_osm with the correct scalebar, without distorting the osm-raster-layer.
library( tidyverse)
library( tmap)
library( tmaptools)
library( sf)...
1
vote
1
answer
21
views
Get Count from tRest in Talend
I am using a tRest component to get data from a web service.
The tLogRow indicates a count value that I would like to get, but don't know how.
{"result":[my data blabla multiple fields],&...
0
votes
1
answer
59
views
Problem saving a tmap file: Receive error message - Unknown format. tm should be either a tmap output, or a list of tmap outputs
In RStudio, I cannot get the map created by the following tmap script to save to my working directory. When running the script prior to the tmap_save line, I receive no errors. However, when I run ...
0
votes
1
answer
85
views
how to set map scale with tmap in r?
I'm struggling to change the scale of my map using the tmap package. I've attempted to adjust various parameters using the 'scale' argument in the tmap_save function, but it seems that this doesn't ...
0
votes
1
answer
97
views
Draw data ellipses at spatial locations
I have a data objects that contains a sample of measurements obtained for two air pollutants at a series of monitoring stations. I also have the spatial coordinates of these stations. For example:
...
0
votes
0
answers
34
views
tmap centralize tm_fill title above legend
I need to center the title above the legend. I've tried many combinations of title X legend parameters of tm_layout, to no avail.
I am using tmap 3.3.4.
My last code:
ce_map <- tm_shape(shp_setor) ...
0
votes
0
answers
23
views
tmap is mapping non-"value" numbers from a raster
I have images from a FLIR camera that I'm trying to examine as rasters in R. When I copy the image here:
right-click and 'Save As', the weird behavior doesn't happen. So I've stuck an example image ...
0
votes
1
answer
25
views
Talend Lookup: Retrieving Client IDs Based on Client Names
I have the following tables :
Sale ID,Sale Amount,Client 1,Client 2
1,500,John,Alice
2,700,Bob,Sarah
3,300,Alice,Michael
4,900,Sarah,Bob
Client Name,Client ID
John,100
Alice,101
Bob,102
Sarah,103
...
0
votes
1
answer
52
views
Hi! I have a shapefile with the geodata for areas within london. trying to make a tmap and include data of crime rate from a csv file how do i do this
So i have the shapefile with all the geodata that i need
so far my code i have tried is this
tm_shape(LSOA_London) + tm_fill( "$Crime_rate", palette = "spectral") + tm_border()
...
2
votes
1
answer
113
views
How to add compass and scale_bar only once in tm_facets of tmap?
I want to add compass and scale_bar only once while using tm_facets. Here is an example code
library(tmap)
library(stars)
library(terra)
#Read some data
tif = system.file("tif/L7_ETMs.tif", ...
0
votes
1
answer
54
views
0 not being mapped to white in diverging palette
I am currently generating several maps with diverging palettes. Below is an example.
hom_trend_2019_2023 = (tm_shape(houston_zip) +
tm_polygons(col="hom_change_2019_2023", border.alpha=0.1, ...
1
vote
0
answers
31
views
Tmap in R : How can I set hist legend on maps?
I'm new to working with geographic data, and I'm trying to add a histogram legend with following code.
density <-
tm_shape(density)+
tm_borders(col = "lightgrey") +
tm_fill( "...
0
votes
0
answers
28
views
tmap inner border colour based on region
From my previous question I got help to label border regions by different colours. However the issue I'm noticing is as the borders are plotted, they overlap and block other borders.
library(sf)
...