getImputedData {MOFA} | R Documentation

## getImputedData

### Description

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

### Usage

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

### Arguments

`object` | a trained `MOFAmodel` object.
`views` | character vector with the view name(s), or numeric vector with the view 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`.

### Value

By default returns a list where each element is a matrix with dimensionality (D,N), where D is the number of features in this view and N is the number of samples.
Alternatively, if `as.data.frame` is `TRUE`, returns a long-formatted data frame with columns (view,feature,sample,value).

### Examples

    # load a trained MOFAmodel object
    filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
    MOFAobject <- loadModel(filepath)
    # impute missing values
    MOFAobject <- impute(MOFAobject)
    # get imputations for a single view
    imputedDrugs <- getImputedData(MOFAobject,view="Drugs")
    head(imputedDrugs)

[Package MOFA version 1.0.0 Index]