Learn R Programming

RandomWalker

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 {TidyDensity} 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.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()

Copy Link

Version

Install

install.packages('RandomWalker')

Monthly Downloads

411

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Steven Sanderson

Last Published

September 15th, 2024

Functions in RandomWalker (0.1.0)

cvar

Cumulative Variance
rw_range

Range
skewness_vec

Compute Skewness of a Vector
visualize_walks

Visualize Walks
discrete_walk

Discrete Sampled Walk
cmean

Cumulative Mean
chmean

Cumulative Harmonic Mean
brownian_motion

Brownian Motion
cmedian

Cumulative Median
cgmean

Cumulative Geometric Mean
csd

Cumulative Standard Deviation
convert_snake_to_title_case

Helper function to convert a snake_case string to Title Case
cskewness

Cumulative Skewness
crange

Cumulative Range
ckurtosis

Cumulative Kurtosis
random_normal_walk

Generate Multiple Random Normal Walks
rand_walk_helper

Random Walk Helper
euclidean_distance

Distance Calculations
geometric_brownian_motion

Geometric Brownian Motion
rw30

Generate Random Walks
random_normal_drift_walk

Generate Multiple Random Walks with Drift
summarize_walks

Summarize Walks Data
kurtosis_vec

Compute Kurtosis of a Vector
generate_caption

Helper function to generate a caption string based on provided attributes