Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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: ...
agila's user avatar
  • 3,630
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/...
Lana Meijinhos's user avatar
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=...
marine-ecologist's user avatar
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. ...
SiH's user avatar
  • 1,516
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&...
almr27's user avatar
  • 43
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 ...
vinceroni's user avatar
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 ...
Joke O.'s user avatar
  • 577
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) ...
Maël's user avatar
  • 50.9k
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 ...
Maël's user avatar
  • 50.9k
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 ...
SiH's user avatar
  • 1,516
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 ...
ulima2_'s user avatar
  • 1,306
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 ...
ulima2_'s user avatar
  • 1,306
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 ...
Oceanous's user avatar
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) ...
ulima2_'s user avatar
  • 1,306
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 ...
David M. Kaplan's user avatar

15 30 50 per page
1
2 3 4 5 6