Skip to content

Instantly share code, notes, and snippets.

View bryangoodrich's full-sized avatar

Bryan Goodrich bryangoodrich

View GitHub Profile
@bryangoodrich
bryangoodrich / GameOfLife.R
Last active September 9, 2016 15:01
I want to play a game ... Conway's Game of Life! For explanation, see http://en.wikipedia.org/wiki/Conway's_Game_of_Life
#' Execute a round of the Game of Life
#'
#' I want to play a game. Specifically, Conway's Game of Life.
#'
#' @param x a matrix populated with 0s and 1s.
#' @param birth a vector indicating the birthing rule. Defaults to 3.
#' @param stay a vector indicating the stay alive rule Defaults to c(2,3).
#' @return a matrix representing an updated input matrix according to the rules
#' @references \url{http://en.wikipedia.org/wiki/Conway's_Game_of_Life}
#' @author Bryan Goodrich
@bryangoodrich
bryangoodrich / LambdaLists.r
Last active July 28, 2020 13:19
List Out Of Lambda [in R] An adaptation of Steve Losh's JavaScript exploration[1] with a hat tip to Hadley Wickham's Advanced R Programming[2] that led me there. References [1] http://stevelosh.com/blog/2013/03/list-out-of-lambda/ [2] http://adv-r.had.co.nz/
# Created by Bryan Goodrich
# Version 0.1
#
# Title: List Out Of Lambda [in R]
#
# An adaptation of Steve Losh's JavaScript exploration[1] with a hat tip to
# Hadley Wickham's Advanced R Programming[2] that led me there.
#
# References
# [1] http://stevelosh.com/blog/2013/03/list-out-of-lambda/