Skip to content

Instantly share code, notes, and snippets.

Avatar

Hannah Flaherty hannahflaherty

View GitHub Profile
View squirls.Rmd
---
title: "Tidy Squirrels"
output: html_notebook
---
```{r, message=FALSE}
library(readr)
library(dplyr)
View phone_knights.R
library(lazyeval)
library(dplyr)
phone_knight_combinations <- function(n, starting_value = 1) {
mapping <- data.frame(this_value = c(1,1,6,6,6,7,7,2,2,9,9,4,4,4,3,3,8,8,0,0),
next_value = c(6,8,1,7,0,6,2,7,9,2,4,9,0,3,4,8,1,3,4,6)
)
combinations <- data.frame(value_1 = c(starting_value), this_value = c(starting_value))
for (i in 2:n) {
combinations <- merge(combinations, mapping)