Creates a vector of integer study identifiers corresponding to the rows of a CompadreDB object, based on unique combinations of the columns 'Authors', 'Journal', 'YearPublication', and 'DOI.ISBN' (or optionally, a different set of columns supplied by the user).

cdb_id_studies(cdb, columns = c("Authors", "Journal", "YearPublication",
  "DOI.ISBN"))

Arguments

cdb

A CompadreDB object

columns

Vector of column names from which unique combinations should be identified. Defaults to c("Authors", "Journal", "YearPublication", "DOI.ISBN").

Value

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

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.

See also

Examples

Compadre$StudyID <- cdb_id_studies(Compadre)