getPatientFromSample {psichomics} | R Documentation

## Get patients from given samples

### Description

Get patients from given samples

### Usage

    getPatientFromSample(sampleId, patientId = NULL, na = FALSE,
      sampleInfo = NULL)

    getSubjectFromSample(sampleId, patientId = NULL, na = FALSE,
      sampleInfo = NULL)

### Arguments

`sampleId` | Character: sample identifiers
`patientId` | Character: patient identifiers to filter by (optional; if a matrix or data frame is given, its rownames will be used to infer the patient identifiers)
`na` | Boolean: return NA for samples with no matching patients
`sampleInfo` | Data frame or matrix: sample information containing the sample identifiers as rownames and a column named "Subject ID" with the respective subject identifiers

### Value

Character: patient identifiers corresponding to the given samples

### Examples

    samples <- paste0("GTEX-", c("ABC", "DEF", "GHI", "JKL", "MNO"), "-sample")
    getPatientFromSample(samples)

    # Filter returned samples based on available patients
    patients <- paste0("GTEX-", c("DEF", "MNO"))
    getPatientFromSample(samples, patients)

[Package psichomics version 1.8.2 Index]