map_bias: Mapping Projected Bias Effects

View source: R/map_bias.R

map_biasR Documentation

Mapping Projected Bias Effects

Description

A plotting function to visualize the effect of accessibility bias caused by different biasing factors in space.

Usage

map_bias(x, gaz = NULL, sealine = TRUE, type = "sampling_rate")

Arguments

x

a raster stack as generate by project_bias

gaz

a list of SpatialObjects, to be printed on the maps. Should be the same objects provided to calculate_bias when creating the Object. If gaz is not supplied, the sampbias package standard gazetteers are used.

sealine

logical. Should the coastline be added to the plots? Default is to TRUE.

type

character vector. One of c("sampling_rate", "log_sampling_rate", "diff_to_max"). If "sampling_rate". the plot shows the raw projected sampling rate depending on the biasing factors, if "log_sampling_rate", the plot shows the log10 transformed sampling rate, and if "diff_to_max", the relative deviation of sampling rate from the maximum rate as calculated using calculate_bias and projected using project_bias. For instance, a value of -25 indicates a drop of 25 (e.g. in a road on river flowing through the city airport).

Value

A series of R plots based on ggplot2.

See Also

calculate_bias, project_bias

Examples

## Not run: 
  #simulate data
  occ <- data.frame(species = rep(sample(x = LETTERS, size = 5), times = 10),
                   decimalLongitude = runif(n = 50, min = 12, max = 20),
                   decimalLatitude = runif(n = 50, min = -4, max = 4))

  out <- calculate_bias(x = occ, terrestrial = TRUE)
  proj <- project_bias(out)
  map_bias(proj)

## End(Not run)


azizka/sampbias documentation built on Feb. 1, 2024, 7:51 p.m.