set_covariates | R Documentation |
Function to add continuous covariate(s) to a MOFA
object for training with MEFISTO
set_covariates(object, covariates)
object |
an untrained |
covariates |
Sample-covariates to be passed to the model. This can be either:
Note that the covariate should be numeric and continuous. |
To activate the functional MEFISTO framework, specify mefisto_options when preparing the training using prepare_mofa
Returns an untrained MOFA
with covariates filled in the corresponding slots
#' # Simulate data
dd <- make_example_data(sample_cov = seq(0,1,length.out = 100), n_samples = 100, n_factors = 4)
# Create MOFA object
sm <- create_mofa(data = dd$data)
# Add a covariate
sm <- set_covariates(sm, covariates = dd$sample_cov)
sm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.