View source: R/species_distribution.R
species_distribution | R Documentation |
A Species Distribution is a tibble::tibble containing species abundances or probabilities. Rows of the tibble are communities and column are species. Values are either abundances or probabilities. Special columns contain the site names, and their weights (e.g. their area or number of individuals): their names must be "site" and "weight". All other column names are considered as species names.
species_distribution(x, names = NULL, weights = NULL, check_arguments = TRUE)
as_species_distribution(x, ...)
## S3 method for class 'numeric'
as_species_distribution(x, ..., check_arguments = TRUE)
## S3 method for class 'matrix'
as_species_distribution(
x,
names = NULL,
weights = NULL,
...,
check_arguments = TRUE
)
## S3 method for class 'data.frame'
as_species_distribution(x, ..., check_arguments = TRUE)
## S3 method for class 'wmppp'
as_species_distribution(x, ..., check_arguments = TRUE)
## S3 method for class 'character'
as_species_distribution(x, ..., check_arguments = TRUE)
## S3 method for class 'factor'
as_species_distribution(x, ..., check_arguments = TRUE)
is_species_distribution(x)
as_probabilities(x, ...)
## S3 method for class 'numeric'
as_probabilities(x, ..., check_arguments = TRUE)
## S3 method for class 'matrix'
as_probabilities(x, names = NULL, weights = NULL, ..., check_arguments = TRUE)
## S3 method for class 'data.frame'
as_probabilities(x, ..., check_arguments = TRUE)
## S3 method for class 'wmppp'
as_probabilities(x, ..., check_arguments = TRUE)
## S3 method for class 'character'
as_probabilities(x, ..., check_arguments = TRUE)
## S3 method for class 'factor'
as_probabilities(x, ..., check_arguments = TRUE)
is_probabilities(x)
abundances(
x,
round = TRUE,
names = NULL,
weights = NULL,
check_arguments = TRUE
)
as_abundances(x, ...)
## S3 method for class 'numeric'
as_abundances(x, round = TRUE, ..., check_arguments = TRUE)
## S3 method for class 'matrix'
as_abundances(
x,
round = TRUE,
names = NULL,
weights = NULL,
...,
check_arguments = TRUE
)
## S3 method for class 'data.frame'
as_abundances(x, ..., check_arguments = TRUE)
## S3 method for class 'wmppp'
as_abundances(x, ..., check_arguments = TRUE)
## S3 method for class 'character'
as_abundances(x, ..., check_arguments = TRUE)
## S3 method for class 'factor'
as_abundances(x, ..., check_arguments = TRUE)
is_abundances(x)
## S3 method for class 'species_distribution'
as.matrix(x, use.names = TRUE, ...)
## S3 method for class 'species_distribution'
as.double(x, use.names = TRUE, ...)
## S3 method for class 'species_distribution'
as.numeric(x, use.names = TRUE, ...)
x |
an object. |
names |
The names of the species distributions. |
weights |
the weights of the sites of the species distributions. |
check_arguments |
if |
... |
Unused. |
round |
If |
use.names |
If |
species_distribution
objects include abundances
and probabilities
objects.
species_distribution()
creates a species_distribution
object from a vector
or a matrix or a dataframe.
as_species_distribution()
, as_abundances()
and as_probabilities
format
the numeric, matrix or dataframe x
so that appropriate
versions of community functions (generic methods such as plot or
div_richness) are applied.
Abundance values are rounded (by default) to the nearest integer.
They also accept a dbmss::wmppp objects,
i.e. a weighted, marked planar point pattern and count the abundances of
point types, character and factor objects.
as_probabilities()
normalizes the vector x
so that it sums to 1. It gives
the same output as probabilities()
with estimator = "naive"
.
species_distribution
objects objects can be plotted by plot and autoplot.
An object of classes species_distribution
and abundances
or probabilities
.
as.double()
and its synonymous as.numeric()
return a numeric vector
that contains species abundances or probabilities of a single-row
species_distribution
.
as.matrix()
returns a numeric matrix if the species_distribution
contains
several rows.
These are methods of the generic functions for class species_distribution
.
# Paracou data is a tibble
paracou_6_abd
# Class
class(paracou_6_abd)
is_species_distribution(paracou_6_abd)
# Whittaker plot fitted by a log-normal distribution
autoplot(paracou_6_abd[1,], fit_rac = TRUE, distribution = "lnorm")
# Character vectors
as_abundances(c("A", "C", "B", "C"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.