View source: R/random_generators.R

Random integer values simulation | R Documentation |

Random integer values simulation.

```
Sample.int(n, size = n, replace = FALSE)
Sample(x, size, replace = FALSE)
```

`x` |
A numeric vector for sampling. |

`n` |
This must be an integer value. The function will then draw random integer values from 1:n. |

`size` |
The number of integer values to sample. |

`replace` |
Do you want to sample with replacement? If yes, set this equal to TRUE. |

The function does the same job, up to some level, with R's built-in fuction `sample.int`

.

A vector with integer values.

Manos Papadakis.

R implementation: Manos Papadakis <papadakm95@gmail.com>. R documentation: Michail Tsagris <mtsagris@yahoo.gr>.

```
Runif, rbeta1, riag
```

```
x <- Sample.int(10, 1000, replace = TRUE)
Sample(x,length(x))
```

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.