cdb_id_studies: Create a vector of unique study identifiers from a COM(P)ADRE...

View source: R/cdb_id_studies.R

cdb_id_studiesR Documentation

Create a vector of unique study identifiers from a COM(P)ADRE database

Description

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).

Usage

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").

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 study 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

cdb_id

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

Examples

Compadre$StudyID <- cdb_id_studies(Compadre)


Rcompadre documentation built on Sept. 3, 2023, 1:07 a.m.