MyNixOS website logo
Description

Generate Random Walks Compatible with the 'tidyverse'.

Generates random walks of various types by providing a set of functions that are compatible with the 'tidyverse'. The functions provided in the package make it simple to create random walks with a variety of properties, such as how many simulations to run, how many steps to take, and the distribution of random walk itself.

RandomWalker

CRAN_Status_Badge Lifecycle:experimental PRsWelcome

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  1.52 
#>  3 1               3  2.02 
#>  4 1               4  1.82 
#>  5 1               5 -0.120
#>  6 1               6  0.588
#>  7 1               7  0.412
#>  8 1               8  0.998
#>  9 1               9  1.37 
#> 10 1              10  0.826

Here is a basic visualization of a Random Walk:

rw30() |>
  visualize_walks()
Visualize a Random Walk of 30 simulations

Here is a basic summary of the random walks:

rw30() |>
  summarize_walks(.value = y)
#> # A tibble: 1 × 16
#>   fns   fns_name dimensions mean_val median range quantile_lo quantile_hi
#>   <chr> <chr>         <dbl>    <dbl>  <dbl> <dbl>       <dbl>       <dbl>
#> 1 rw30  Rw30              1   -0.670 -0.132  47.4       -18.3        14.2
#> # ℹ 8 more variables: variance <dbl>, sd <dbl>, min_val <dbl>, max_val <dbl>,
#> #   harmonic_mean <dbl>, geometric_mean <dbl>, skewness <dbl>, kurtosis <dbl>

rw30() |>
  summarize_walks(.value = y, .group_var = walk_number)
#> # A tibble: 30 × 17
#>    walk_number fns   fns_name dimensions mean_val  median range quantile_lo
#>    <fct>       <chr> <chr>         <dbl>    <dbl>   <dbl> <dbl>       <dbl>
#>  1 1           rw30  Rw30              1  -0.951   0.0447 15.6       -10.5 
#>  2 2           rw30  Rw30              1  -0.947  -2.02   13.5        -5.69
#>  3 3           rw30  Rw30              1  -2.91   -3.42   12.9        -8.84
#>  4 4           rw30  Rw30              1  -0.0432  0.299  11.1        -4.63
#>  5 5           rw30  Rw30              1  -4.28   -4.52   12.8        -9.94
#>  6 6           rw30  Rw30              1  -1.77   -1.71   14.6        -9.60
#>  7 7           rw30  Rw30              1  -3.51   -3.43   13.6        -9.47
#>  8 8           rw30  Rw30              1  -4.25   -3.94   20.1       -14.8 
#>  9 9           rw30  Rw30              1   1.93    2.16    7.11       -1.46
#> 10 10          rw30  Rw30              1   0.621   1.20   13.7        -5.59
#> # ℹ 20 more rows
#> # ℹ 9 more variables: quantile_hi <dbl>, variance <dbl>, sd <dbl>,
#> #   min_val <dbl>, max_val <dbl>, harmonic_mean <dbl>, geometric_mean <dbl>,
#> #   skewness <dbl>, kurtosis <dbl>
Metadata

Version

0.2.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows