Package 'biasProxyR'

Title: 'Sampling Effort Proxies' for 'Species Distribution Models'
Description: Addresses geographic sampling bias in 'Species Distribution Models' (SDMs) for data-poor regions. It generates sampling effort proxies using open-source infrastructure data, allowing researchers to sample bias-aware background points. This prevents models from learning sampling artifacts instead of true ecological niches. The spatial data processing relies on methods described in 'Hijmans' (2025) <doi:10.32614/CRAN.package.terra> and 'Pebesma' (2018) <doi:10.32614/CRAN.package.sf>.
Authors: Aamna Naveed [aut, cre] (ORCID: <https://orcid.org/0009-0001-3371-1066>)
Maintainer: Aamna Naveed <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-11-19 13:15:19 UTC
Source: https://github.com/aamnanaveed/biasproxyr

Help Index


Diagnose Sampling Bias in Occurrence Data

Description

Plots occurrence points over a sampling effort proxy surface and calculates a "Bias Correlation Score" to quantify how much the data is skewed toward human infrastructure.

Usage

diagnose_sampling_bias(occurrences, effort_surface)

Arguments

occurrences

An sf object containing occurrence points.

effort_surface

A SpatRaster of sampling effort.

Value

A list containing the bias score (percentage) and a diagnostic message.

Examples

try({
    effort <- generate_effort_surface("Luxembourg", resolution = 10000)
    bg_points <- sample_bias_aware_background(effort, n_points = 10)
    diagnose_sampling_bias(bg_points, effort)
  })

Generate a Sampling Effort Proxy Surface

Description

Downloads road data for a given country and calculates distance to roads to create a proxy for human sampling effort.

Usage

generate_effort_surface(country = "Pakistan", resolution = 10000)

Arguments

country

Character. Name of the country (e.g., "Pakistan").

resolution

Numeric. Output raster resolution in meters.

Value

A SpatRaster object where higher values indicate higher probability of human sampling effort (closer to roads).

Examples

try({
    effort <- generate_effort_surface("Luxembourg", resolution = 10000)
  })

Sample Bias-Aware Background Points

Description

Draws background points from a sampling effort proxy surface, ensuring that background points are sampled in proportion to the estimated sampling effort.

Usage

sample_bias_aware_background(effort_surface, n_points = 100)

Arguments

effort_surface

A SpatRaster of sampling effort.

n_points

Integer. Number of background points to sample.

Value

An sf object containing the sampled background points.

Examples

try({
    effort <- generate_effort_surface("Luxembourg", resolution = 10000)
    bg_points <- sample_bias_aware_background(effort, n_points = 10)
  })