subset_factors: Subset factors

View source: R/subset.R

subset_factorsR Documentation

Subset factors

Description

Method to subset (or sort) factors

Usage

subset_factors(object, factors, recalculate_variance_explained = TRUE)

Arguments

object

a MOFA object.

factors

character vector with the factor names, or numeric vector with the index of the factors.

recalculate_variance_explained

logical indicating whether to recalculate variance explained values. Default is TRUE.

Value

A MOFA object

Examples

# Using an existing trained model on simulated data
file <- system.file("extdata", "model.hdf5", package = "MOFA2")
model <- load_model(file)

# Subset factors 1 to 3
model <- subset_factors(model, factors = 1:3)

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