library(ggplot2)
set.seed(123)
discrete_walk()
set.seed(123)
discrete_walk(.num_walks = 30, .n = 250, .upper_probability = 0.55) |>
ggplot(aes(x = x, y = cum_sum)) +
geom_line(aes(group = walk_number), alpha = .618, color = "steelblue") +
theme_minimal() +
theme(legend.position = "none") +
geom_smooth(method = "lm", se = FALSE)
Run the code above in your browser using DataLab