PAM_from_table: Creates presence-absence matrix from a data.frame

Description Usage Arguments Value Examples

View source: R/pam_helpers.R

Description

Creates a presence-absence matrix (PAM) from a data.frame that contains species names and identifiers of positions where species are found.

Usage

1
PAM_from_table(data, ID_column, species_column)

Arguments

data

data.frame of species found in distinct positions (defined by identifiers). Must include at least two columns: "ID" and "Species".

ID_column

(character) name of the column containing identifiers.

species_column

(character) name of the column containing species names.

Value

Species' presence (1) and absence (0) matrix for a set of positions defined by identifiers.

Examples

1
2
3
4
5
6
7
# Data
data("sp_data", package = "biosurvey")

# PAM
pam <- PAM_from_table(data = sp_data, ID_column = "ID",
                      species_column = "Species")
pam[1:10, c(1, 21:25)]

biosurvey documentation built on Sept. 16, 2021, 1:07 a.m.