Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
65 views

I'm trying to plot multiple geographical maps in SpatRaster using terra, eg.: > library(tidyterra) > library(terra) > library(ggplot2) > str(edata) S4 class 'SpatRaster' \[package "...
insua's user avatar
  • 11
-4 votes
1 answer
122 views

I have a column that contains the place of residence of participants. Some reported as "city/village, country", "postcode city, country", "region, country", etc. There ...
Olivia's user avatar
  • 183
2 votes
1 answer
137 views

I tried to access global elevation raster data from two sources: Source 1 (Natural earth): I downloaded raster data of world elevation from here: https://www.naturalearthdata.com/downloads/10m-raster-...
Patrick's user avatar
  • 1,339
2 votes
2 answers
135 views

I downloaded raster data of world elevation from here: https://www.naturalearthdata.com/downloads/10m-raster-data/10m-cross-blend-hypso/ --> Cross Blended Hypso with Relief, Water, Drains, and ...
Patrick's user avatar
  • 1,339
2 votes
1 answer
194 views

Using R, I am attempting to create a plot that contains both geom_spatraster and geom_spatvector objects, and I am running into issues with the legend. Using the repex at the bottom below, the legend ...
KAR's user avatar
  • 35
1 vote
2 answers
131 views

When I was working on the visualisation of spatial data (vector and raster), I ran into some tricky issues: Involves projection conversion of coordinate systems, range conversion of data, and ggplot::...
Breeze's user avatar
  • 586
0 votes
1 answer
129 views

When plotting global data using tidyterra, I'm experiencing a weird issue with the way the data wraps around the edges of the map (e.g. the -180/180 boundary). As shown in the example below, ...
Jaken's user avatar
  • 601
1 vote
1 answer
87 views

I'm trying to use tidyterra's scale_*_whitebox_b() to bin continuous values using custom breaks that are unevenly distributed, to emphasize the difference in the low values. I'm having trouble because ...
Jaken's user avatar
  • 601
1 vote
1 answer
72 views

When using tidyterra for multi-layer raster plotting, the facet_* function doesn't seem to work effectively when one of the layers has the null value “NA”. I'm not sure if this is a bug or if there is ...
Breeze's user avatar
  • 586
0 votes
1 answer
112 views

I'm making a map of this island and whenever I try to plot it using tidyterra::geom_spatraster_RGB() there are these white dots and the graph is more pale than when I use terra::plot_RGB(). I ...
nicolr7's user avatar
1 vote
1 answer
103 views

I would like to create a world map showing the global distribution of coral reefs in combination with the two 20°C isotherms. I have managed to plot them individually, but not in a single graph. The ...
maRvin's user avatar
  • 375
0 votes
2 answers
386 views

I have a data frame with about 20,000 rows containing the latitude and longitude of points spread across the world. I need to determine the population density at those points, so I considered using ...
Olivia's user avatar
  • 183
1 vote
1 answer
205 views

In R, package tidyterra allows use of facet_wrap(~lyr) to plot multiple spatial raster layers in one figure. library(terra) library(ggplot2) library(tidyterra) x <- rast(array(data = rnorm(120,0,1),...
Dan B's user avatar
  • 41
0 votes
2 answers
86 views

It's probably a stupid mistake but I can't figure out what I am doing wrong. I have a DEM raster I can visualize using plot() and ggplot() just fine. But when I try to crop and mask it to a smaller ...
tlyons253's user avatar
  • 117
3 votes
1 answer
402 views

I am trying to plot a subregion of a large raster (e.g., just Arizona out of a raster that covers North America) using tidyterra and ggplot2. I have tried setting the limits of the plot by setting the ...
Eonema's user avatar
  • 1,368
2 votes
1 answer
1k views

I'm trying to add a basemap to some of my figures. It seems like the basemaps package is the best way to go, but I haven't been able to get it to work. Here's the original code for the figure, which ...
rsmarcus's user avatar
  • 115
0 votes
2 answers
90 views

I would like to combine the map p with the map x in the following way: at those points where the plot x is white, I would like to see plot p (as first layer), and for the colored points the plot x, as ...
MPB_2022's user avatar
  • 303
1 vote
1 answer
331 views

I have been trying to solve a sizing issue with 3x3 grid of plots with ggplot, cowplot and tidyterra. The plots are spatial rasters, that need a shared legend for each row, a title in the first row, ...
Francis van Oordt's user avatar
0 votes
1 answer
310 views

I would like to modify the colors across which my palette operate, to expand the yellow region so that extreme values in my figure stand out more dramatically. I can't figure out how to change this, ...
Cameron's user avatar
  • 330
0 votes
1 answer
201 views

I have a GIS vector file containing multiple attribute columns, such as t1, t2, t3, up to t8. My objective is to create individual plots for each attribute column within a panel display. Despite my ...
gis.rajan's user avatar
  • 517
0 votes
1 answer
503 views

I have a raster list (raster data with 6 layers) with Continuous values. Now I would like to visualize them using R::tidyterra. I have two questions: 1、How to represent the continuous values by ...
Wei Liao's user avatar
3 votes
2 answers
505 views

I am drawing a raster map with points on it in ggplot2 using tidyterra: library(ggplot2) library(rnaturalearth) library(terra) library(tidyterra) backmap <- ne_download(scale=50, type="...
taprs's user avatar
  • 175
1 vote
1 answer
842 views

I want to be able truncate the colour pallete for certain values of a raster using ggplot, which I am able to do using basic plotting of the terra object, but not with ggplot2. This is what I have ...
Francis van Oordt's user avatar
0 votes
1 answer
193 views

I am plotting multiple projected raster objects (SpatRaster or raster stack; equal area projection; EPSG:3035), all having the same extent. Example map However, the mapped grid cells are distorted, ...
Ahmed El-Gabbas's user avatar
0 votes
1 answer
193 views

This question came up after getting the answer to the question. Basically, I have a dataframe (please see reproducible data below) with columns that I want to visualise with rgb color-composite (the ...
bird's user avatar
  • 3,374
1 vote
1 answer
377 views

I have a dataframe df (please see reproducible data below) with x, y, a, b, c columns. I compute rgb (red, greeb, blue) color composite: # compute rgb df$rgb = rgb(df$a, df$b, df$c) Then, I want to ...
bird's user avatar
  • 3,374
2 votes
2 answers
297 views

I am trying to use scales::pretty_breaks with geom_spatraster like library(terra) library(ggplot2) library(tidyterra) r1 <- rast(system.file("ex/elev.tif", package="terra")) r2 ...
UseR10085's user avatar
  • 8,306