Skip to content

Instantly share code, notes, and snippets.

@noamross
Created December 15, 2020 13:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save noamross/c887d6a0c1d85bba683f43086d78f7a8 to your computer and use it in GitHub Desktop.
library(ggplot)
library(sf)
library(ggspatial)
library(snapbox)
library(raster)
worldclim <- raster::getData('worldclim', var='prec', res=2.5, lon = 142.61, lat = -23.64)
area <- st_bbox(
c(xmin = 101.03, ymin = -44.82, xmax = 168.23, ymax = -9.09),
crs = 4326
)
rast <- raster::crop(worldclim[[1]], extent(area))
ggplot() +
layer_spatial(rast) +
layer_mapbox(area,
map_style = "mapbox://styles/noamross/ckipi0rfl3ybv17p9dnom27ir/draft",
scale_ratio = 1)
@noamross
Copy link
Author

Screen Shot 2020-12-15 at 8 54 36 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment