Package 'blender'

Title: Analyze biotic homogenization of landscapes
Description: Tools for assessing exotic species' contributions to landscape homogeneity using average pairwise Jaccard similarity and an analytical approximation derived in Harris et al. (2011, "Occupancy is nine-tenths of the law," The American Naturalist). Also includes a randomization method for assessing sources of model error.
Authors: David J. Harris <[email protected]>
Maintainer: David J. Harris <[email protected]>
License: GPL-2 | Artistic-2.0
Version: 0.1.2
Built: 2024-11-03 03:34:22 UTC
Source: https://github.com/davharris/blender

Help Index


Calculate biotic homogenization using Jaccard's index and an approximation

Description

blend finds native landscape similarity and exotic species' contributions to landscape homogeneity using average pairwise Jaccard similarity (J.Bar) and an analytical approximation (J.Star) described in Harris et al. (2011, "Occupancy is nine-tenths of the law," The American Naturalist) and in blender.basics.

blend can be called on a list of data.frames or on a character vector pointing to a directory containing data as .csv files.

If blend is called multiple landscapes, it will analyze each one individually and then combine the results together in a blended.landscape.bundle, which has its own method for plotting.

Usage

blend(x, warn = FALSE)

Arguments

x

Either the file path to your landscapes as .csv files (character vector) or a list of data.frames. The files or data.frames must be named and structured as described below. On Windows, the directory must use either double backslashes or single forward slashes to separate directories (e.g., R cannot read "c:\Users\Dave\Data").

warn

Logical. Should blender warn you if it encounters problems when smoothing your data? Defaults to FALSE.

Details

J.Bar, J.Star, and P.Star are defined in Harris et al. (2011) and in the documentation for blender.basics.

blend expects a character vector pointing to .csv files on your hard drive or a list of data.frames.

The files or data.frames must be named to include a landscape ID (e.g. "Iowa" or "Region 7") before the word "native" or "exotic", separated by a space, as in the included PLANTS data set. blend needs these names to match for the native and exotic landscape in order to compare them. Any landscapes that do not have a counterpart will not be included in the output. If blend cannot find any matching native-exotic landscape pairs, it will return an error.

blend expects sites as columns and species as rows. In .csv files, the first row must be site names and the first column must be species names. If you input data as data.frames, these attributes should be included as dimnames instead. The column names, corresponding to site names, must match between the native and exotic landscapes.

The body of your files or data.frames should be 1s indicating species presence at a given site, or 0s for absences.

Value

blend returns a blended.landscape object if called on a single landscape or a blended.landscape.bundle if called on more than one. A bundle includes all of the below for each landscape, plus a summary data.frame.

blended.landscape objects contain:

name

The name of the landscape analyzed (e.g. "Nebraska" if the contents of x included "Nebraska native table" and "Nebraska exotic table")

J.Bar, J.Star

J.Bar is the average Jaccard similarity among sites in the native landscape (i.e. the average ratio of shared species to total species among pairs of sites).

J.Star is the approximation from Harris et al: average number of species shared between each pair of sites divided by the average number of species present at least once among pairs in the native landscape.

delta.J.Bar, delta.J.Star

delta.J.Bar is the increase or decrease in average Jaccard similarity observed when incorporating the full complement of exotic species

delta.J.Star is the corresponding increase or decrease in J.Star.

R2

The proportion of variance in single-species changes in J.Bar explained by variance in single-species changes in J.Star.

threshold

The proportion of sites that must be occupied by an exotic species for it to have no net effect on J.Bar, Calculated by smoothing the observed delta.J.Bars in species.delta.table using the loess function. Will return NA if data cannot be smoothed near this point.

p.Star

The proportion of sites that must be occupied by an exotic species for it to have no effect on mean similarity, according to the effective occupancy equation in Harris et al.(which is based on J.Star)

nadir

The level of exotic occupancy for which mean similarity is minimized. Calculated by smoothing the observed delta.J.Bars in species.delta.table using the loess function. Will return NA if data cannot be smoothed near this point.

results.table

A summary data.frame containing all the above information (except name).

species.delta.table

A data.frame containing delta.J.Bars and delta.J.Stars attributed to each of the exotic species in the exotic data table individually.

scoop

A set of points used for plotting the "scoop"-shaped model predictions

native, exotic

The original imported landscapes

If called on more than one landscape, blend produces a blended.landscape.bundle, which includes one blended.landscape for each landscape included, as well as a data.frame called summary that includes all the information from each landscape's resuls.table.

Author(s)

David Jay Harris <[email protected]>

References

Harris, D. J., K. G. Smith, and P. J. Hanly. 2011. "Occupancy is nine-tenths of the law: Occupancy rates determine the homogenizing and differentiating effects of exotic species" The American Naturalist.

See Also

blender.basics

Examples

data(PLANTS)

wy.results = blend(PLANTS[c("WY native table", "WY exotic table")])

# print a summary of the results 
wy.results

# plot contributions of individual exotic species to mean similarity
plot(wy.results)

# blend a set of five landscapes simultaneously
five.results = blend(PLANTS[1:(5 * 2)])

## Not run: 
  # Alternative method of calling blend using a directory
  five.results = blend("Users/Dave/Documents/similarity stuff/state matrices")

## End(Not run)

# print a summary of the results across all landscapes
five.results

# plot predictions vs. observations across all landscapes
plot(five.results)

# plot contributions of individual exotic species to mean similarity in 
# the first landscape
plot(five.results[[1]])

Basic landscape calculations

Description

jbar calculates average Jaccard similarity among sites (columns) in your landscape as the expected ratio of the intersection between two sites to to their union:

J.Bar = mean(intersection/union)

jstar gives an approximation of this value from species occupancy rates (row sums) as the ratio of the expected intersection between two randomly chosen sites to the expected union:

J.Star = mean(intersection)/mean(union)

pstar gives the "effective occupancy" of a landscape, defined in Harris et al. (2011). A landscape composed entirely of species with this occupancy rate would have the same J.Star value as the input landscape.

Usage

jbar(x)
  jstar(x, n = NULL)
  pstar(x, n = NULL)

Arguments

x

For jbar, a binary data.frame with species as rows and sites as columns. For jstar and pstar, either a data.frame or a numeric vector containing the proportion of sites occupied by each species.

n

The number of sites in your landscape. Only needed for jstar and pstar if x is numeric.

Author(s)

David Jay Harris <[email protected]>

References

Harris, D. J., K. G. Smith, and P. J. Hanly. 2011. "Occupancy is nine-tenths of the law: Occupancy rates determine the homogenizing and differentiating effects of exotic species." The American Naturalist.

See Also

blend

Examples

data(PLANTS)
  
  # Calculate key values for Wyoming from raw data
  landscape = PLANTS[["WY native table"]]
  
  jbar(landscape)
  jstar(landscape)
  pstar(landscape)
  
  
  # jstar and pstar also work if given row means and landscape sizes.
  # jbar requires spatial information that is lost during this averaging.
  occupancy = rowMeans(landscape)
  nsites = ncol(landscape)
  
  jstar(occupancy, nsites)
  pstar(occupancy, nsites)

USGS PLANTS database data

Description

This data set includes county-level occupancy for native and exotic plants in 47 US states

Usage

data(PLANTS)

Format

List containing a data.frame for the native species in each state and a second data.frame for the exotic species in each state. Each data frame is organized with counties as columns and species as rows.

Details

Per the USDA PLANTS Database website, species were listed as "native" if their L48 native status was listed as N, N?, NI, or NI? and "exotic" if their L48 native status was listed as GP, GP?, I, I?, N?I, W, or W?. See http://plants.usda.gov/about_adv_search.html for descriptions of these terms.

The USDA PLANTS Database does not include county-level data on Alaska or Maryland. Hawaii was excluded from this data set because L48 native status did not apply to it.

Source

The USDA PLANTS Database can be found at http://plants.usda.gov/

References

USDA, NRCS. 2010. The PLANTS Database (http://plants.usda.gov, November 23, 2010). National Plant Data Center, Baton Rouge, LA 70874-4490 USA.

Used as an example in Harris et al. 2011. "Occupancy is nine-tenths of the law" The American Naturalist.


Simulate reduced richness landscapes

Description

reduce randomly selects species for inclusion in a reduced-richness landscape based on the original. shuffle randomizes species locations among sites.

Usage

blender.reduce(landscape, richness)
  blender.shuffle(landscape)

Arguments

landscape

A binary presence-absence data.frame for species (rows) at sites(columns)

richness

An integer number of species to include in a reduced landscape

Details

Species are sampled by reduce without replacement. Species are randomized by shuffle in order to preserve their occupancy rates (row sums) but not local richness (column sums).

Value

A data.frame based on landscape

Author(s)

David J. Harris <[email protected]>

References

These functions were used in the simulations in Harris, D. J., K. G. Smith, and P. J. Hanly. 2011. "Occupancy is nine-tenths of the law: Occupancy rates determine the homogenizing and differentiating effects of exotic species." The American Naturalist.