R: Mixture visualization of a 'PLNmixturefit' object

plot.PLNmixturefit {PLNmodels} | R Documentation

## Mixture visualization of a `PLNmixturefit` object

### Description

Represent the result of the clustering either by coloring the individual in a two-dimension PCA factor map, or by representing the expected matrix of count reorder according to the clustering.

### Usage

    ## S3 method for class 'PLNmixturefit'
    plot(x, type = c("pca", "matrix"), main = NULL, plot = TRUE, ...)

### Arguments

`x` | an R6 object with class `PLNmixturefit`
`type` | character for the type of plot, either "pca", for or "matrix". Default is `"pca"`.
`main` | character. A title for the plot. If NULL (the default), an hopefully appropriate title will be used.
`plot` | logical. Should the plot be displayed or sent back as `ggplot` object
`...` | Not used (S3 compatibility).

### Value

a `ggplot` graphic

### Examples

    data(trichoptera)
    trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
    myPLN <- PLNmixture(Abundance ~ 1 + offset(log(Offset)),
               data = trichoptera, control_main = list(iterates = 0))  %>% getBestModel()
    plot(myPLN, "pca")
    plot(myPLN, "matrix")

[Package PLNmodels version 0.11.4 Index]