summarise_factors: Summarise factor values using external groups

View source: R/correlate_covariates.R

summarise_factorsR 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


bioFAM/MOFA2 documentation built on June 12, 2024, 3:57 p.m.