Package 'tidysdm'

Title: Sprecies Distribution Modelling with Tidymodels
Description: Provides functions and classes to help create Species Distribution Models (SDMs) within the {tidymodels} framework. Provides new {parsnip} models, new {recipes} steps, and {yardstick} metrics. This package provides access to the powerful {tidymodels} ecosystem for SDMs, especially the package {spatialsample} for spatially aware cross validation and model evaluation, as well as opening up all classification models implemented in {parsnip} for presence-only SDMs, using the pseudo-absence approach.
Authors: Russell Dinnage [aut, cre]
Maintainer: Russell Dinnage <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-20 06:23:01 UTC
Source: https://github.com/rdinnager/tidysdm

Help Index


Add environmental variables

Description

Add environmental variables

Usage

add_env_vars(x, env)

Arguments

env

Make background from points

Description

Make background from points

Usage

create_background(
  x,
  method = c("convex_hull", "point_buffer", "ecoregion", "concave_hull", "grid_fill",
    "user_fill"),
  buffer = 0,
  max_bg = NULL,
  grid_options = NULL,
  concave_options = NULL
)

Arguments

concave_options

Generate a grid of values for making predictions

Description

Generate a grid of values for making predictions

Usage

create_prediction_grid(bg, n = 10000, square = TRUE, include_polygons = FALSE)

Arguments

include_polygons

Get Spatial Neighbours

Description

Get Spatial Neighbours

Usage

get_spatial_neighbours(
  x,
  k = 8,
  maxdist = 1e+05,
  progress = TRUE,
  parallel = 1
)

Arguments

x

An sf object

k

The number of nearest neighbours to retrieve

maxdist

The maximum distance to get nearest neighbours from

progress

Print progess bar?

parallel

How many parallel cores to use.

Value

A list of neighbour indices


Spatial Cross Validation Designed for Presence-Only Data

Description

Spatial Cross Validation Designed for Presence-Only Data

Usage

po_spatial_buffer_vfold_cv(
  data,
  radius = NULL,
  buffer = 0.1,
  v = 10,
  repeats = 1,
  presence = NULL,
  pool = 0.1,
  ...
)

Arguments

...

Convert presence points and a background area into an sdm_data object suitable for a tidysdm workflow.

Description

Convert presence points and a background area into an sdm_data object suitable for a tidysdm workflow.

Usage

sdm_data(pres, bg, n = 500, abs = NULL, sample_options = list(), ...)

Arguments

pres

Points representing species occurrences. Should be an sf object with crs information

bg

A background area as an sf polygon or a raster mask (in stars or raster format)

n

Integer specifying the number of background or pseudo-absence points to sample from the background as specified by bg.

abs

Optionally an sf object with true absence data in the form of points.

...

Value

A sdm_data object inheriting from a tibble


Title

Description

Title

Usage

step_sample_pseudo_absences(
  recipe,
  bg_geometry = NULL,
  role = NA,
  trained = FALSE,
  size,
  options = list(type = "random", exact = FALSE),
  skip = FALSE,
  id = rand_id("sample_pseudo_absences")
)

Arguments

id