get_covariates {MOFA2} | R Documentation

## Get sample covariates

### Description

Function to extract the covariates from a `MOFA` object using MEFISTO.

### Usage

    get_covariates(
      object,
      covariates = "all",
      as.data.frame = FALSE,
      warped = FALSE
    )

### Arguments

`object` | a `MOFA` object.
`covariates` | character vector with the covariate name(s), or numeric vector with the covariate index(es).
`as.data.frame` | logical indicating whether to output the result as a long data frame, default is `FALSE`.
`warped` | logical indicating whether to extract the aligned covariates

### Value

a matrix with dimensions (samples,covariates). If `as.data.frame` is `TRUE`, a long-formatted data frame with columns (sample,factor,value)

### Examples

    # Using an existing trained model
    file <- system.file("extdata", "MEFISTO_model.hdf5", package = "MOFA2")
    model <- load_model(file)
    covariates <- get_covariates(model)

[Package MOFA2 version 1.4.0 Index]