Learn R Programming

amt (version 0.2.2.0)

hr_to_sf: Convert home ranges to sfc

Description

Convert a list column with many home-range estimates to a tibble with a geometry column (as used by the sf-package).

Usage

hr_to_sf(x, ...)

# S3 method for tbl_df hr_to_sf(x, col, ...)

Value

A data.frame with a simple feature column (from the sf) package.

Arguments

x

A tibble with a list column with individual home ranges.

...

Additional columns that should be transferred to the new tibble.

col

The column where the home

Examples

Run this code

data("amt_fisher")
hr <- amt_fisher |> nest(data = -id) |>
  mutate(hr = map(data, hr_mcp), n = map_int(data, nrow)) |>
  hr_to_sf(hr, id, n)

hr <- amt_fisher |> nest(data = -id) |>
  mutate(hr = map(data, hr_kde), n = map_int(data, nrow)) |>
  hr_to_sf(hr, id, n)


Run the code above in your browser using DataLab