st_as_sf.Extent: Extent to sf

Description Usage Arguments Examples

View source: R/sf_functions.R

Description

Extent to sf

Usage

1
2
## S3 method for class 'Extent'
st_as_sf(x)

Arguments

x

raster Extent object

Examples

1
2
3
4
5
6
7
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 Aug. 10, 2021, 11:01 a.m.