get_imputed_data: Get imputed data

Description Usage Arguments Details Value Examples

View source: R/get_methods.R

Description

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

Usage

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

1
2
3
4
5
# 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)

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