subsetViews {MOFA} | R Documentation

## Subset views

### Description

Method to subset (or sort) views. This function can remove entire views from the model. For example, you might want to generate the `plotVarianceExplained` plot excluding a particular view.
This functionality is only for exploratory purposes. If some view(s) are not of interest we strongly recommend removing them before training the model.

### Usage

    subsetViews(object, views)

### Arguments

`object` | a `MOFAmodel` object.
`views` | character vector with the view names, numeric vector with the view indices or logical vector with the view to be kept as TRUE.

### Value

`MOFAmodel` object with a subset of views

### Examples

    # Using an existing trained model on the CLL data
    filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata")
    MOFA_CLL <- loadModel(filepath)
    # Subset views via character vector
    MOFA_CLL_small <- subsetViews(MOFA_CLL, views=c("Drugs","Methylation"))
    MOFA_CLL_small
    # Subset views via numeric vector
    MOFA_CLL_small <- subsetViews(MOFA_CLL, views=2:3)
    MOFA_CLL_small

[Package MOFA version 1.0.0 Index]