Hi, I suspect this question is possibly quite basic.

I have a probability vector like the following:

```
probs <- c(0.1, 0.4, 0.2, 0.3)
```

These values correspond to the probability of a value being a 1, 2, 3 or 4 (based on their position in the vector). IE The probability of 4 is 0.3.

What I am looking to do is generate N random draws of these values based on these probabilities. I was imagining something akin to the likes of `rbinom`

or `rnorm`

but I can't seem to find anything like that for categorical data.

Is there an easy / good way of doing this?

Thanks!