Beautiful Maps with R (V): Point densities | One world #32
Replies: 1 comment
|
Answering to a previous comment (pre-migration to giscus comments:
So Maybe you have skipped previous steps (i.e. the creation of library(terra)
#> terra 1.7.65
library(giscoR)
library(sf)
library(dplyr)
library(ggplot2)
library(tidyterra)
# Create an owin
owin <- gisco_get_countries(country = "LU", spatialtype = "LB") %>%
st_buffer(10000) %>%
st_transform(4326)
# Read with owin, will zoom to where we expect
f <- system.file("ex/elev.tif", package = "terra")
r <- rast(f, win = tidyterra::as_spatvector(owin))
autoplot(r) +
geom_sf(data = owin, fill = NA)# no owin
r2 <- rast(f)
autoplot(r2) +
geom_sf(data = owin, fill = NA)Created on 2024-01-24 with reprex v2.1.0 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Beautiful Maps with R (V): Point densities | One world
Bertin's dot density maps with R and GHSL - Another way to represent demographics on a map.
https://dieghernan.github.io/202312_bertin_dots/
All reactions