The package brownianMotion does the simulation for 1 dimension or 2 dimension Brownian motion and gives the corresponding plot for the simulation path.
First, load the library.
library(brownianMotion)
Simulate 1 dimension brownian motion.
x <- sim1dBM(10000, 1)
Simulate 2 dimension brownian motion.
x <- sim2dBM(10000, 1)
Plot the simulation path.
plotBM(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.