The goal of RandomWalker is to allow users to easily create Random
Walks of different types that are compatible with the
tidyverse
suite of packages. The package is currently in
the experimental stage of development.
You can install the released version of {TidyDensity} from CRAN with:
install.packages("RandomWalker")
You can install the development version of RandomWalker from GitHub with:
# install.packages("devtools")
::install_github("spsanderson/RandomWalker") devtools
This is a basic example which shows you how to solve a common problem:
library(RandomWalker)
## basic example code
rw30() |>
head(10)
#> # A tibble: 10 × 3
#> walk_number x y
#> <fct> <int> <dbl>
#> 1 1 1 0
#> 2 1 2 0.776
#> 3 1 3 1.29
#> 4 1 4 0.408
#> 5 1 5 1.10
#> 6 1 6 0.905
#> 7 1 7 0.579
#> 8 1 8 1.83
#> 9 1 9 2.61
#> 10 1 10 1.43
Here is a basic visualization of a Random Walk:
rw30() |>
visualize_walks()