Learn R Programming

PLNmodels (version 1.2.2)

getModel.PLNPCAfamily: Model extraction from a collection of models

Description

Model extraction from a collection of models

Usage

# S3 method for PLNPCAfamily
getModel(Robject, var, index = NULL)

getModel(Robject, var, index)

# S3 method for PLNmixturefamily getModel(Robject, var, index = NULL)

# S3 method for Networkfamily getModel(Robject, var, index = NULL)

# S3 method for PLNnetworkfamily getModel(Robject, var, index = NULL)

# S3 method for ZIPLNnetworkfamily getModel(Robject, var, index = NULL)

Value

Sends back an object with class PLNPCAfit or PLNnetworkfit.

Arguments

Robject

an R6 object with class PLNPCAfamily or PLNnetworkfamily

var

value of the parameter (rank for PLNPCA, sparsity for 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.

Methods (by class)

  • getModel(PLNPCAfamily): Model extraction for PLNPCAfamily

  • getModel(PLNmixturefamily): Model extraction for PLNmixturefamily

  • getModel(Networkfamily): Model extraction for PLNnetworkfamily or ZIPLNnetworkfamily

  • getModel(PLNnetworkfamily): Model extraction for PLNnetworkfamily

  • getModel(ZIPLNnetworkfamily): Model extraction for ZIPLNnetworkfamily

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab