Check out below code. It's an example to simulate random walk with drift.
library(dplyr)
library(ggplot2)
rerun(5, rnorm(100)) %>%
set_names(paste0("sim", 1:5)) %>%
map(~ accumulate(., ~ .05 + .x + .y)) %>%
map_dfr(~ tibble(value = .x, step = 1:100), .id = "simulation") %>%
ggplot(aes(x = step, y = value)) +
geom_line(aes(color = simulation)) +
ggtitle("Simulations of a random walk with drift")
In the above code, rerun creates sample data 5 times .map_dfr() return data frames created by row-binding and column-binding respectively. accumulate returns data point values from random values.