View fun_w_rapply.R
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
library(magrittr) | |
str_replace_all <- function(text, pattern, replacement){ | |
gsub(pattern = pattern, replacement = replacement, x = text, perl = TRUE) | |
} | |
str_remove_all <- function(text, pattern){ | |
str_replace_all(text, pattern = pattern, replacement = "") | |
} |
View self_rendering_md.css
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
@import url('https://fonts.googleapis.com/css?family=Inconsolata&display=swap'); | |
body { | |
--text-color: #2b2a2a; | |
--link-color: #005fb1; | |
font-family: 'Inconsolata', monospace; | |
font-size: 15px; | |
color: var(--text-color); | |
} |
View simulate_mnar_data.R
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
library(tidyverse) | |
n <- 150 | |
sensitivity_threshold <- 5 | |
data <- tibble( | |
a = rgamma(n = n, shape = 5, rate = 0.5), | |
b = rgamma(n = n, shape = a/2, rate = 0.5) | |
) | |
generate_missing_data <- function(i){ |
View no_good_very_bad_data.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
x | |
0.8749728356504094 | |
0.9658539380522311 | |
1.0988786266989092 | |
0.9270070375557564 | |
1.1795131996034487 | |
1.0716089699247264 | |
0.8728550463211999 | |
1.0682964292826937 | |
0.9766832723965019 |
View index.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<script>(function() { | |
// If window.HTMLWidgets is already defined, then use it; otherwise create a | |
// new object. This allows preceding code to set options that affect the | |
// initialization process (though none currently exist). | |
window.HTMLWidgets = window.HTMLWidgets || {}; |
View spell_data.csv
We can't make this file beautiful and searchable because it's too large.
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
time,direction,accel,label,recording_id,caster | |
0.057,m_x,-0.1,Alohomora,1_aiknf,Nick | |
0.102,m_x,-0.15,Alohomora,1_aiknf,Nick | |
0.154,m_x,-0.36,Alohomora,1_aiknf,Nick | |
0.205,m_x,-0.52,Alohomora,1_aiknf,Nick | |
0.254,m_x,-0.92,Alohomora,1_aiknf,Nick | |
0.307,m_x,-1.32,Alohomora,1_aiknf,Nick | |
0.356,m_x,-1.23,Alohomora,1_aiknf,Nick | |
0.407,m_x,-1.02,Alohomora,1_aiknf,Nick | |
0.458,m_x,-0.99,Alohomora,1_aiknf,Nick |
View simpleD3Scatter.R
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
library(tidyverse) | |
library(htmltools) | |
# devtools::install_github('ramnathv/htmlwidgets') | |
library(htmlwidgets) | |
# devtools::install_github('timelyportfolio/d3r') | |
library(d3r) | |
data <- data_frame(x = rnorm(50), y = rnorm(50)); | |
browsable( |
View general_data.JSON
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
{"edges":[{"from":1,"to":5550},{"from":1,"to":5551},{"from":2,"to":5559},{"from":2,"to":5560},{"from":2,"to":5561},{"from":3,"to":5550},{"from":3,"to":5551},{"from":3,"to":5559},{"from":3,"to":5560},{"from":4,"to":5550},{"from":4,"to":5551},{"from":4,"to":5552},{"from":4,"to":5553},{"from":4,"to":5555},{"from":4,"to":5556},{"from":4,"to":5561},{"from":5,"to":5550},{"from":5,"to":5551},{"from":6,"to":5550},{"from":6,"to":5551},{"from":7,"to":5550},{"from":7,"to":5551},{"from":8,"to":5558},{"from":9,"to":5550},{"from":9,"to":5551},{"from":9,"to":5561},{"from":10,"to":5550},{"from":10,"to":5551},{"from":10,"to":5552},{"from":10,"to":5554},{"from":10,"to":5555},{"from":10,"to":5556},{"from":10,"to":5559},{"from":11,"to":5550},{"from":11,"to":5551},{"from":11,"to":5561},{"from":12,"to":5550},{"from":12,"to":5551},{"from":13,"to":5550},{"from":13,"to":5551},{"from":14,"to":5550},{"from":14,"to":5551},{"from":14,"to":5561},{"from":15,"to":5550},{"from":15,"to":5551},{"from":16,"to":5557},{"from":16,"to":5561},{"from |
View file199f5b2f550a.R
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
library(tidyverse) | |
get_boot_int <- function(n){ | |
data <- data_frame( | |
outcome = rnorm(n, 60, 20), | |
treat = sample(c(0,1), n, replace = T) | |
) %>% | |
mutate(outcome = ifelse(treat == 1, outcome + 5, outcome)) | |
data %>% | |
group_by(treat) %>% |
View file199f5eb98261.R
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: "Homework6" | |
author: "Ben Lane" | |
date: "11/22/2017" | |
output: pdf_document | |
--- | |
### Grade 44/50 |
NewerOlder