createPatientProfileVar: Create link to patient profile

View source: R/miscellaneous.R

createPatientProfileVarR Documentation

Create link to patient profile

Description

Create a link to a patient profile directory (where the patient profile files are saved) by adding an extra column with the link in the data. The path to the patient profile is built as: [patientProfilePath]/subjectProfile-[subjectID].pdf, where '/' are replaced with '-' in the subject identifier (subjectVar).

Usage

createPatientProfileVar(
  data,
  patientProfilePath,
  subjectVar = "USUBJID",
  checkExist = TRUE
)

Arguments

data

a data.frame

patientProfilePath

string indicating the directory where the patient profiles are stored.

subjectVar

string indicating which column in the data represents the unique subject identifier, "USUBJID" by default.

checkExist

Logical, if TRUE (by default) the patientProfilePath is checked for existence, and an error is returned if this directory doesn't exist.

Value

A data.frame with two extra columns: patientProfilePath and patientProfileLink with the path to the patient profile and an hyperlink to it, respectively.

Author(s)

Michela Pasetto

Examples

# Typical CDISC dataset contains universal subject ID (USUBJID)
data <- data.frame(USUBJID = c("subj1", "subj2", "subj3"))
dataWithPatientProfileVar <- createPatientProfileVar(
  data = data, 
  patientProfilePath = "pathProfiles", 
  checkExist = FALSE
)
# path and HTML link are included in the output dataset
head(dataWithPatientProfileVar[, c("USUBJID", "patientProfilePath", "patientProfileLink")])

clinDataReview documentation built on March 7, 2023, 5:13 p.m.