as_per_km2: Standardize unit to density per km^2

View source: R/as_units.R

as_per_km2R Documentation

Standardize unit to density per km2

Description

Standardize number to density per km2.

Usage

as_per_km2(x, unit)

Arguments

x

numeric vector.

unit

character vector of spatial units (e.g., "km2", "acres", "hectares". For convenience, a single character value can be specified if all values in x are the same unit.

Value

A numeric vector.

Examples

as_per_km2(5, "km2")
as_per_km2(5, "acres")
as_per_km2(c(5, 10), "ha")
as_km2(c(5, 10), c("ha", "acres"))


prioritizr documentation built on Nov. 10, 2025, 5:07 p.m.