getMatchingSamples {psichomics} | R Documentation

## Get samples matching the given patients

### Description

Get samples matching the given patients

### Usage

    getMatchingSamples(patients, samples, clinical = NULL, rm.NA = TRUE,
      match = NULL, showMatch = FALSE)

    getSampleFromPatient(patients, samples, clinical = NULL, rm.NA = TRUE,
      match = NULL, showMatch = FALSE)

    getSampleFromSubject(patients, samples, clinical = NULL, rm.NA = TRUE,
      match = NULL, showMatch = FALSE)

### Arguments

`patients` | Character or list of characters: patient identifiers
`samples` | Character: sample identifiers
`clinical` | Data frame or matrix: clinical dataset
`rm.NA` | Boolean: remove NAs? TRUE by default
`match` | Integer: vector of patient index with the sample identifiers as name to save time (optional)
`showMatch` | Boolean: show matching patient index? FALSE by default

### Value

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

### Examples

    patients <- c("GTEX-ABC", "GTEX-DEF", "GTEX-GHI", "GTEX-JKL", "GTEX-MNO")
    samples <- paste0(patients, "-sample")
    clinical <- data.frame(samples=samples)
    rownames(clinical) <- patients
    getMatchingSamples(patients[c(1, 4)], samples, clinical)

[Package psichomics version 1.6.2 Index]