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.
Installation
You can install the released version of {RandomWalker} from CRAN with:
install.packages("RandomWalker")
You can install the development version of RandomWalker from GitHub with:
# install.packages("devtools")
devtools::install_github("spsanderson/RandomWalker")
Example
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.895
#> 3 1 3 -1.21
#> 4 1 4 -0.805
#> 5 1 5 -1.42
#> 6 1 6 -2.50
#> 7 1 7 -2.58
#> 8 1 8 -3.19
#> 9 1 9 -3.46
#> 10 1 10 -3.90
Here is a basic visualization of a Random Walk:
rw30() |>
visualize_walks()