This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(ggplot2) | |
library(ggimage) | |
if(!require(camcorder)){ | |
remotes::install_github("thebioengineer/camcorder") | |
library(camcorder) | |
} | |
gg_record() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tt_recording_env <- new.env() | |
tt_record <- function(dir = tempdir(), | |
device = c("png", "jpeg", "bmp", "tiff", "emf", "svg", "eps"), | |
scale = 1, | |
width = NA, | |
height = NA, | |
units = c("in", "cm", "mm"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
output: html_document | |
editor_options: | |
chunk_output_type: inline | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
library(dplyr) | |
# remotes::install_github("thebioengineer/colortable") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "R Notebook" | |
output: html_notebook | |
editor_options: | |
chunk_output_type: inline | |
--- | |
```{r setup} | |
library(tibble) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# what object size should be prevented from being printed. Defaults to ~ 30mb, which is not very large | |
options("print_protect.print_size_bytes" = "30000") | |
# This method ONLY applies to functions sent to print.default (ie. matrix & vectors) | |
print.default <- function(x, ...) { | |
x_bytes <- as.numeric(utils::object.size(x)) | |
answer <- "NA" | |
if (interactive() & | |
x_bytes > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "NFL Game Crosstalk" | |
author: "Ellis Hughes" | |
date: "12/18/2019" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snake<-setRefClass("snake", | |
fields=list( | |
# System variables | |
body="matrix", | |
food = "numeric", | |
direction='character', | |
length="numeric", | |
dead="logical", | |
#game info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`%>>>%`<-function(lhs,rhs){ | |
parent <- parent.frame() | |
env <- new.env(parent = parent) | |
chain_parts <- magrittr:::split_chain(match.call(), env = env) | |
eval(as.call(call("%>%",call("%>%",chain_parts$lhs$lhs,substitute(play)),chain_parts$lhs$rhs))) | |
} | |
play<-function(lhs){ | |
delayedexpr<-as.list(attr(lhs,"delayedeval")) | |
delayedFunc<-delayedexpr[[length(delayedexpr)]] |