All Questions
79
questions
0
votes
1
answer
99
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
1
answer
197
views
How to add multiple points to map with tmap in R?
I'm learning how to make maps with R so I'm kinda new to all of this. I'm using tmap to plot a map (you can find the shp here https://www.data.rio/datasets/%C3%A1reas-program%C3%A1ticas-da-sa%C3%BAde/...
0
votes
0
answers
47
views
pkgdown::build_article() fails with large chunk sizes using sf and leaflet, no errors reported when setting quiet=FALSE
pkgdown::build_articles() fails with large chunk sizes
rmarkdown::render() works fine
article fails to render any code or text beyond the failed chunk
no errors are reported with build_article(quiet=...
1
vote
3
answers
90
views
Plot two counties side by side while preserving scale
Is there a way to plot the two counties side by side (without changing actual scale) to compare their sizes.
I wish to plot San Diego and Santa Clara side by side to demonstrate their actual size.
...
1
vote
1
answer
79
views
Is there a way to use one border for each created group in tmap R?
I'm trying to replicate this map:
Unfortunately there aren't any available shapefiles for those regions, but I do know the provinces in each group.
When I run this code, I get:
x <- c("ggmap&...
2
votes
0
answers
172
views
Transforming geos_geomtries to sf geometries raises error (Error: Not compatible with STRSXP: [type=NULL])
I've been experimenting with data.table + geos (see https://grantmcdermott.com/fast-geospatial-datatable-geos/ for the example I followed), but I've had issues converting the data.table+geos object ...
6
votes
0
answers
171
views
Label a map with lead lines/call out using tmap in R
I am trying to produce a map using the tmap library. I want to label all areas and use lead lines to label tiny areas. I'm looking for a line of code that works like ggrepel in ggplot2 or ...
0
votes
0
answers
194
views
Plot points and polygons from the same data in tmap
I am trying to plot multiple geometries from the same data set in tmap.
Consider the following data set. Some of the features are centroids (points) and others are polygons.
library(sf)
library(tmap)
...
0
votes
1
answer
154
views
Impossible to plot OSM multipolygons in tmap and leaflet
I'm extracting data from OpenStreetMap using osmdata, and from the query I get a set of points, lines, polygons, and multipolygons. Somehow, when trying to plot multipolygons, leaflet and tmap do not ...
0
votes
1
answer
73
views
How do I plot lines joining each pair of centroids of polygons in the `tmap`
How do I plot lines joining each pairs of centroids of countries in the tmap? The color (or transparency) of line should represent the the total population of countries joined.
Example of how map ...
0
votes
1
answer
130
views
Zoom in rectangularly in map
I'm trying to have a rectangular "zoom in" into my chart. So far, I can create the chart itself and a smaller version, but I haven't figured out how to zoom in rectangularly.
(Builds on 1 ...
2
votes
3
answers
165
views
Get more aggregate shapes from shapefile
As described in this previous question, I'm plotting German zip codes. The most granular level is 5-digit, e.g. 10117. I would like to draw boundaries defined on the two digit level around, while also ...
0
votes
2
answers
126
views
Custom Tmap palette based on results
I'm trying to create a custom palette for tmap in R where the colours represent a result from a general election.
In the below photo you can see my plot doesn't have a palette attached and is using ...
0
votes
1
answer
475
views
Plot state provinces around map colored by German zip codes
I'm trying to create a map, where I color by German zip codes and I would like to add German states as boundaries.
# for loading our data
library(raster)
library(readr)
library(readxl)
library(sf)
...
1
vote
1
answer
265
views
Color points in tmap by date column
I am trying to color a set of geographical points by a time variable using the tmap function tm_dots, but it keeps treating the time variable as a categorical variable. Is there a way to use a POSIXct ...