Skip to contents

measure_vector_kgc() counts the Köppen-Geiger climate classification in the range cropped with raster_kgc(), and calculates the basic spatial features of a vector geometry such as perimeter and area. quantify_vector_kgc(), in addition, summarizes the counts.

Usage

quantify_vector_kgc(geom, overwrite = FALSE)

measure_vector_kgc(geom, overwrite = FALSE)

Arguments

geom

An sfc or sf object. A path to sf-readable file is accepted.

overwrite

A logical. If TRUE, the cache is not used and overwritten. Relevant only when geom is a path to a file.

Value

quantify_vector_kgc() returns a data.frame.

measure_vector_kgc() returns a list.

Examples

geom = rnaturalearth::ne_countries(country = "Japan") |> sf::st_geometry()
measure_vector_kgc(geom)
#> $kgc
#>  [1]    0    0    0    0    0    0    0    0 3637  307    0    0    0    0    0
#> [16]    0    0   31 1689  150    0    0    0    0    0    0    0    0    0    0
#> [31]    0  151
#> 
#> $perimeter
#> [1] 6474035
#> 
#> $area
#> [1] 404420164917
#> 

quantify_vector_kgc(geom)
#>   perimeter         area abundance richness idx_shannon idx_simpson
#> 1   6474035 404420164917      5814        5   0.9301313   0.4791999
#>   idx_brillouin
#> 1      0.927681