cdb_id: Create integer identifiers for a COM(P)ADRE database...

View source: R/cdb_id.R

cdb_idR Documentation

Create integer identifiers for a COM(P)ADRE database corresponding to unique combinations of a given set of columns

Description

Creates a vector of integer identifiers corresponding to the rows of a CompadreDB object, based on unique combinations of the elements in a given set of columns.

Usage

cdb_id(cdb, columns)

Arguments

cdb

A CompadreDB object

columns

Vector of column names from which unique combinations should be identified

Details

Identifiers are assigned by pasting together the relevant columns, assigning factor levels based on alphabetical order, and then converting the factor levels to integers.

Value

Vector of integer identifiers corresponding to the rows of cdb, based on unique combinations of the elements in columns.

Author(s)

Patrick Barks <patrick.barks@gmail.com>

See Also

Other data management: cdb_flatten(), cdb_id_stages(), cdb_id_studies(), cdb_mean_matF(), cdb_rbind(), cdb_unflatten(), cdb_unnest(), mpm_elementwise_apply(), mpm_mean(), mpm_median(), mpm_sd(), string_representation

Examples

cdb_id(Compadre, columns = c("SpeciesAuthor", "MatrixTreatment"))


Rcompadre documentation built on Oct. 17, 2024, 1:07 a.m.