How to do Simulation in R Studio