get_imputed_data: Get imputed data

View source: R/get_methods.R

get_imputed_dataR Documentation

Get imputed data

Description

Function to get the imputed data. It requires the previous use of the impute method.

Usage

get_imputed_data(
  object,
  views = "all",
  groups = "all",
  features = "all",
  as.data.frame = FALSE
)

Arguments

object

a trained MOFA object.

views

character vector with the view name(s), or numeric vector with the view index(es). Default is "all".

groups

character vector with the group name(s), or numeric vector with the group index(es). Default is "all".

features

list of character vectors with the feature names or list of numeric vectors with the feature indices. Default is "all".

as.data.frame

logical indicating whether to return a long-formatted data frame instead of a list of matrices. Default is FALSE.

Details

Data is imputed from the generative model of MOFA.

Value

A list containing the imputed valued or a data.frame if as.data.frame is TRUE

Examples

# Using an existing trained model
file <- system.file("extdata", "model.hdf5", package = "MOFA2")
model <- load_model(file)
model <- impute(model)
imputed <- get_imputed_data(model)

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