add_sitestat: Site statistics of 'nodiv' data objects

View source: R/Add_to_data_object.R

sitestatR Documentation

Site statistics of nodiv data objects

Description

Adds, plots or reads site statistics from objects in the nodiv package

Usage

add_sitestat(distrib_data, site_stat, site = NULL)
plot_sitestat(distrib_data, x, shape = NULL, type = c("auto",
                 "points", "grid"), ...)
sitestat(distrib_data, statname = NULL, site = NULL)

Arguments

distrib_data

An object of type distrib_data, nodiv_data or nodiv_result

site_stat

A site statistic, such as species richness or mean temperature. This can be a vector or a data.frame. If site is not specified, the function tries to match site_stat to the site names of the distrib_data object. The function looks for vector names, rownames, or variables in the data.frame that match the site names. If sitenames are absent and the number of sitestats match, the sitestat is assumed to be in the correct order.

site

A character or numeric variable specifying the sites in which to enter or read sitestat

statname

The name of a sitestatistic in the distrib_data object. If statname is not given, a list of names of sitestatistics is given

x

A variable to plot on sites, can either be a numeric variable, or the name of a sitestatistic in the distrib_data object

shape

A shape file giving a map to use as a background for the plot

type

A character vector describing the type of data

...

Further arguments to the plotting function

Value

add_sitestat returns the object with the new sitestat inside. sitestat returns the named sitestatistic.

Author(s)

Michael Krabbe Borregaard

See Also

distrib_data


mkborregaard/nodiv documentation built on April 7, 2023, 9:52 a.m.