Learn R Programming

terra (version 1.5-21)

perim: Perimeter or length

Description

This method returns the length of lines or the perimeter of polygons.

When the crs is not longitude/latitude, you may get more accurate results by first un-projecting the SpatVector (you can use project to transform the crs to longitude/latitude)

Usage

# S4 method for SpatVector
perim(x)

Arguments

x

SpatVector

Value

numeric (m)

Examples

Run this code
# NOT RUN {
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
perim(v)
# }

Run the code above in your browser using DataLab