Closed paocorrales closed 9 months ago
Reprex:
library(ggplot2)
file1 <- tempfile()
download.file("https://geodata.ucdavis.edu/cmip6/10m/ACCESS-CM2/ssp585/wc2.1_10m_tmax_ACCESS-CM2_ssp585_2021-2040.tif", destfile = file1)
data <- as.data.frame(terra::rast(file1), xy = TRUE)
mapa_asia <- rnaturalearth::ne_countries(continent = "Asia", returnclass = "sf",
scale = 10)
ggplot(data, aes(x, y)) +
metR::geom_contour_fill(aes(z = tmax01, fill = after_stat(level))) +
geom_sf(data = mapa_asia, inherit.aes = FALSE, fill = NA, color = "black")
ggplot(data, aes(x, y)) +
metR::geom_contour_fill(aes(z = tmax01, fill = after_stat(level)), clip = mapa_asia)
#> Warning: Computation failed in `stat_contour_fill()`:
#> polygons require at least 4 points
Created on 2023-11-06 with reprex v2.0.2
Se cierra con: 2830c571676e564f462962b85819d28a63460385
Este ejemplo no funciona. Es posible que sea un problema con los datos.
Si hago un subset de los datos me aparece este Warning (y no see grafican los contornos):
Warning: Computation failed in
stat_contour_fill()
: not implemented for objects of class sfc_GEOMETRYCOLLECTIONCon los datos completes me devuelve esto:
Warning: Computation failed in
stat_contour_fill()
: polygons require at least 4 points