rPLN | R Documentation |

Random generation for the PLN model with latent mean equal to mu, latent covariance matrix equal to Sigma and average depths (sum of counts in a sample) equal to depths

```
rPLN(
n = 10,
mu = rep(0, ncol(Sigma)),
Sigma = diag(1, 5, 5),
depths = rep(10000, n)
)
```

`n` |
the sample size |

`mu` |
vectors of means of the latent variable |

`Sigma` |
covariance matrix of the latent variable |

`depths` |
Numeric vector of target depths. The first is recycled if there are not |

The default value for mu and Sigma assume equal abundances and no correlation between the different species.

a n * p count matrix, with row-sums close to depths, with an attribute "offsets" corresponding to the true generated offsets (in log-scale).

```
## 10 samples of 5 species with equal abundances, no covariance and target depths of 10,000
rPLN()
## 2 samples of 10 highly correlated species with target depths 1,000 and 100,000
## very different abundances
mu <- rep(c(1, -1), each = 5)
Sigma <- matrix(0.8, 10, 10); diag(Sigma) <- 1
rPLN(n=2, mu = mu, Sigma = Sigma, depths = c(1e3, 1e5))
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.