summarise_factors {MOFA2} | R Documentation

## Summarise factor values using external groups

### Description

Function to summarise factor values using a discrete grouping of samples.

### Usage

    summarise_factors(
      object,
      df,
      factors = "all",
      groups = "all",
      abs = FALSE,
      return_data = FALSE
    )

### Arguments

`object` | a trained `MOFA` object.
`df` | a data.frame with the columns "sample" and "level", where level is a factor with discrete group assigments for each sample.
`factors` | character vector with the factor name(s), or numeric vector with the index of the factor(s) to use. Default is 'all'.
`groups` | character vector with the groups names, or numeric vector with the indices of the groups of samples to use, or "all" to use samples from all groups.
`abs` | logical indicating whether to take the absolute value of the factors (default is `FALSE`).
`return_data` | logical indicating whether to return the fa instead of plotting

### Value

A `ggplot` object or a `data.frame` if return_data is TRUE

[Package MOFA2 version 1.2.2 Index]