st_as_sf.Extent: Extent to sf

View source: R/sf_functions.R

st_as_sf.ExtentR Documentation

Extent to sf

Description

Extent to sf

Usage

## S3 method for class 'Extent'
st_as_sf(x, ...)

Arguments

x

raster Extent object

...

passed on to st_sf

Examples

library(raster)
library(sf)
r1 <- raster(nrows=108, ncols=21, xmn=0, xmx=100)
r2 <- raster(nrows=108, ncols=21, xmn=50, xmx=150)
st2 <- rbind(st_as_sf(extent(r1)),
             st_as_sf(extent(r2)))
plot(st2, border = 1:2)


MatthieuStigler/matPkg documentation built on Sept. 19, 2024, 5:19 a.m.