Description Usage Arguments Details Value Author(s) Examples

Randomly generate probability vectors, that is, non-negative vectors whose elements sum to unity.

1 |

`n` |
the length of the vector. If n is not specified, it is inferred from the lenth of labels. |

`labels` |
a vector of labels for the elements of the vector. If labels is not
specified, n must be specified and the value |

Stochastic (or probability) vectors are non-negative vectors that sum to unity.
This function uniformly generates samples from the set of probability vector sof
length *n*.

At least one of the arguments must be specified. The missing argument is infered from the other.

A probability vector of length *n* with elements named according to labels.

Andrew Hart and Servet Mart<ed>nez

1 2 3 |

```
1 2 3 4
0.1072674 0.3763062 0.1694189 0.3470075
a b c
0.02117224 0.92985777 0.04896999
r R
0.8272403 0.1727597
```

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.