PAM_from_table {biosurvey}R Documentation

Creates presence-absence matrix from a data.frame

Description

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

Usage

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

# 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)]

[Package biosurvey version 0.1.1 Index]