I want to sample the fixed vector c(2,3,4,5) 100 times .I have used the sample function like this

sample(c(2,3,4,5),100)

but I am getting error which is saying that that cannot take sample larger than population.I am not able to understand.

# How to sample a fixed vector in R

**sid100158**#1

**aayushmnit**#2

Hi Sid,

I donâ€™t know if I understand your questions completely. But try this -

```
rep( c(2,3,4,5), times = 100)
```

Regards,

Aayush