summarise_factors: Summarise factor values using external groups

Description Usage Arguments Value

View source: R/correlate_covariates.R

Description

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

Usage

1
2
3
4
5
6
7
8
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


MOFA2 documentation built on Nov. 8, 2020, 7:28 p.m.