#RandomWalker

Steven P. Sanderson II, MPHspsanderson.com@bsky.brid.gy
2025-09-01

Here is a simple script that will create a discrete walk of 100, 1000, 10000, and 100000 steps, I thought it was neat to see the difference in the 2D output. For this I used the RandomWalker package developed by myself and Antti Rask 🦜 #R #RStats #RProgramming #ggplot2 #RandomWalker #Random #tidy

Here is a simple script that will create a discrete walk of 100, 1000, 10000, and 100000 steps, I thought it was neat to see the difference in the 2D output.

For this I used the RandomWalker package developed by myself and Antti Rask 🦜

#R #RStats #RProgramming #ggplot2 #RandomWalker #Random #tidydataHere is a simple script that will create a discrete walk of 100, 1000, 10000, and 100000 steps, I thought it was neat to see the difference in the 2D output.

For this I used the RandomWalker package developed by myself and Antti Rask 🦜

#R #RStats #RProgramming #ggplot2 #RandomWalker #Random #tidydata
Steven P. Sanderson II, MPHspsanderson.com@bsky.brid.gy
2025-08-20

Yes my friend Antti and I just released #RandomWalker 1.0.0 and yes I saw something yesterday that already has me working on 1.1.0 Notice the subtitle of the plot :)

Yes my friend Antti and I just released #RandomWalker 1.0.0 and yes I saw something yesterday that already has me working on 1.1.0

@spsanderson This is awesome! I'm working on a tutorial on drift diffusion models and #RandomWalker is going to be very useful for that project.

Steven P. Sanderson II, MPHspsanderson.com@bsky.brid.gy
2025-07-10

Want to visualize a 2D Random Walk of the Wilcox distribution in #R then the RandomWalker package developed by myself and Antti Rask can do that. #R #RStats #RandomWalker #RandomWalk #Visualization #ggplot2 #TidyData

library(RandomWalker)
library(ggplot2)

random_wilcox_walk(.m = 1, .k = 2, .dimensions = 2) |> 
  ggplot(aes(x = x, y = y)) + 
  geom_path(aes(color = step_number)) + 
  scale_color_viridis_c(option = "plasma") + 
  labs(
    title = "2D Random Wilcox Walk", 
    x = "X Position", 
    y = "Y Position"
  ) + 
  theme_minimal() + 
  theme(legend.position = "none") + 
  theme(
    axis.text.x = element_blank(), 
    axis.ticks.y = element_blank(), 
    axis.text.y = element_blank(), 
    axis.ticks.x = element_blank()
  )library(RandomWalker)
library(ggplot2)

random_wilcox_walk(.m = 1, .k = 2, .dimensions = 2) |> 
  ggplot(aes(x = x, y = y)) + 
  geom_path(aes(color = step_number)) + 
  scale_color_viridis_c(option = "plasma") + 
  labs(
    title = "2D Random Wilcox Walk", 
    x = "X Position", 
    y = "Y Position"
  ) + 
  theme_minimal() + 
  theme(legend.position = "none") + 
  theme(
    axis.text.x = element_blank(), 
    axis.ticks.y = element_blank(), 
    axis.text.y = element_blank(), 
    axis.ticks.x = element_blank()
  )
Alexandre B A Villares 🐍villares@ciberlandia.pt
2023-05-17

A random walker x3 (rotational simetry)
#Processing #Python #py5 #RandomWalker

"""
colorful random paths made of circles in a black background made with the code below
"""

import py5

rotations = 3
margin = 100
vx, vy = 2, 3
brush_x, brush_y = 200, 200

def setup():
    py5.size(600, 600)
    py5.no_stroke()
    py5.color_mode(py5.HSB)  # Hue, Saturation, Brightness
    py5.background(0)


def draw():
    global brush_x, brush_y, vx, vy
    angle = py5.radians(360 / rotations)
    # moves 0, 0 to the center of the canvas
    py5.translate(py5.width / 2, py5.height / 2)
    for i in range(rotations):  # repeats "rotations" times
        py5.rotate(angle)
        py5.fill((py5.frame_count / 10) % 255, 200, 200)
        py5.circle(brush_x - py5.width / 2, brush_y - py5.height / 2, 5)

    vx = vx + py5.random(-0.5, 0.5)
    vy = vy + py5.random(-0.5, 0.5)

    if abs(vx) > 5:
        vx = 0
    if abs(vy) > 5:
        vy = 0

    brush_x = brush_x + vx
    brush_y = brush_y + vy

    if brush_x > (py5.width - margin) or brush_x < margin:
        vx = -vx
    if brush_y > (py5.height - margin) or brush_y < margin:
        vy = -vy

py5.run_sketch()
Daniel Buzzodanbz
2023-01-06
Daniel Buzzodanbz
2023-01-06

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst