createPatientProfileVar: Create link to patient profile

Description Usage Arguments Value Author(s) Examples

View source: R/miscellaneous.R

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

1
2
3
4
5
6
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

1
2
3
4
5
6
7
8
9
# 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 July 14, 2021, 5:08 p.m.