getSampleFromSubject: Get samples matching the given subjects

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

Get samples matching the given subjects

Usage

1
2
3
4
5
6
7
8
getSampleFromSubject(
  patients,
  samples,
  clinical = NULL,
  rm.NA = TRUE,
  match = NULL,
  showMatch = FALSE
)

Arguments

patients

Character or list of characters: subject identifiers

samples

Character: sample identifiers

clinical

Data frame or matrix: clinical dataset

rm.NA

Boolean: remove missing values?

match

Integer: vector of subject index with the sample identifiers as name to save time (optional)

showMatch

Boolean: show matching subject index?

Value

Names of the matching samples (if showMatch = TRUE, a character with the subjects as values and their respective samples as names is returned)

See Also

Other functions for data grouping: createGroupByAttribute(), getGeneList(), getSubjectFromSample(), groupPerElem(), plotGroupIndependence(), testGroupIndependence()

Examples

1
2
3
4
5
subjects <- c("GTEX-ABC", "GTEX-DEF", "GTEX-GHI", "GTEX-JKL", "GTEX-MNO")
samples <- paste0(subjects, "-sample")
clinical <- data.frame(samples=samples)
rownames(clinical) <- subjects
getSampleFromSubject(subjects[c(1, 4)], samples, clinical)

psichomics documentation built on Nov. 8, 2020, 5:44 p.m.