
Model extraction from a collection of models
Source:R/PLNPCAfamily-S3methods.R, R/PLNfamily-S3methods.R, R/PLNmixturefamily-S3methods.R, and 1 more
getModel.RdModel extraction from a collection of models
Usage
# S3 method for class 'PLNPCAfamily'
getModel(Robject, var, index = NULL)
getModel(Robject, var, index)
# S3 method for class 'PLNmixturefamily'
getModel(Robject, var, index = NULL)
# S3 method for class 'Networkfamily'
getModel(Robject, var, index = NULL)
# S3 method for class 'PLNnetworkfamily'
getModel(Robject, var, index = NULL)
# S3 method for class 'ZIPLNnetworkfamily'
getModel(Robject, var, index = NULL)Arguments
- Robject
an R6 object with class
PLNPCAfamilyorPLNnetworkfamily- var
value of the parameter (
rankfor PLNPCA,sparsityfor PLNnetwork) that identifies the model to be extracted from the collection. If no exact match is found, the model with closest parameter value is returned with a warning.- index
Integer index of the model to be returned. Only the first value is taken into account.
Value
Sends back an object with class PLNPCAfit or PLNnetworkfit.
Methods (by class)
getModel(PLNPCAfamily): Model extraction forPLNPCAfamilygetModel(PLNmixturefamily): Model extraction forPLNmixturefamilygetModel(Networkfamily): Model extraction forPLNnetworkfamilyorZIPLNnetworkfamilygetModel(PLNnetworkfamily): Model extraction forPLNnetworkfamilygetModel(ZIPLNnetworkfamily): Model extraction forZIPLNnetworkfamily
Examples
if (FALSE) { # \dontrun{
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPCA <- PLNPCA(Abundance ~ 1 + offset(log(Offset)), data = trichoptera, ranks = 1:5)
myModel <- getModel(myPCA, 2)
} # }