Learn R Programming

PatientProfiles (version 1.4.5)

addConceptName: Add concept name for each concept_id

Description

Add concept name for each concept_id

Usage

addConceptName(table, column = NULL, nameStyle = "{column}_name")

Value

table with an extra column with the concept names.

Arguments

table

cdm_table that contains column.

column

Column to add the concept names from. If NULL any column that its name ends with `concept_id` will be used.

nameStyle

Name of the new column.

Examples

Run this code
# \donttest{
library(PatientProfiles)
library(omock)
library(dplyr, warn.conflicts = FALSE)

cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")

cdm$drug_exposure |>
  addConceptName(column = "drug_concept_id", nameStyle = "drug_name") |>
  glimpse()

cdm$drug_exposure |>
  addConceptName() |>
  glimpse()
# }

Run the code above in your browser using DataLab