Skip to content

Instantly share code, notes, and snippets.

county sample state name exceedances
Mobile 20 al Dauphin Island Water & Sewer 1
Monroe 23 al Excel Water System 1
Washington 95 al Tate & Lyle Sucralose, Inc. Water System 1
Coosa 18.3 al Lake Mitchell Water, Incorporated 1
Juneau City and Borough 15.5 ak Thunder Mountain Mobile Park 1
Juneau City and Borough 31 ak Hecla Greens Creek Hawk Inlet 1
Ketchikan Gateway Borough 27.7 ak Boyer Towing 1
Ketchikan Gateway Borough 32.9 ak Thorne Bay, City Of 1
Ketchikan Gateway Borough 16.2 ak Clover Pass Christian School 2
@trestletech
trestletech / analysis.R
Last active July 7, 2017 16:49
Tidying of pressure-sensitive keystroke dynamics data. Raw available: https://figshare.com/articles/Pressure-sensitive_keystroke_dynamics_data/5170705 . The `isJA` column represents whether or not the user currently typing is "Jeffrey Allen" -- i.e. is the user typing his own name (TRUE) or someone else's (FALSE)?
download.file("https://ndownloader.figshare.com/articles/5170705/versions/1", "kd.zip")
unzip("kd.zip")
library(readr)
words <- readr::read_csv("KSP-Word.csv")
users <- readr::read_csv("KSP-User.csv")
entries <- readr::read_csv("KSP-Entry.csv")
keypress <- readr::read_csv("KSP-KeyPress.csv")
pressure <- readr::read_csv("KSP-Pressure.csv")
@aschleg
aschleg / games_howell.R
Last active November 29, 2017 00:07
R function for performing Games-Howell Post-Hoc Test
games.howell <- function(grp, obs) {
#Create combinations
combs <- combn(unique(grp), 2)
# Statistics that will be used throughout the calculations:
# n = sample size of each group
# groups = number of groups in data
# Mean = means of each group sample
# std = variance of each group sample
library(tidyverse)
## approximates big_df in the post
big_df <- mtcars %>%
select(cyl, mpg, disp) %>%
arrange(cyl) %>%
slice(17:22) %>%
rename(ID = cyl)
## dummy function that needs access to ID and data
sample_id B1 B2 B3 reading_date ward service_line_material
2 8.1 10.8 2.8 aug-15 9 Unknown
4 1.1 BD BD aug-15 1 Copper
7 7.2 1.4 BD aug-15 9 Copper
8 40.6 9.7 6.1 aug-15 9 Lead
12 10.6 1.0 1.3 aug-15 9 Unknown
15 4.4 BD BD aug-15 9 Copper
16 24.4 8.8 4.3 aug-15 5 Galvanized
17 6.6 5.8 1.4 aug-15 2 Unknown
18 4.1 1.1 1.1 aug-15 7 Copper
@stephlocke
stephlocke / scrape.R
Created July 8, 2018 11:41
Scrape and consolidate the year superheroes made their debut in comics
library(tidyverse)
library(rvest)
"https://en.wikipedia.org/wiki/List_of_superhero_debuts" %>%
read_html() %>%
html_nodes(xpath = "//*[@id='mw-content-text']/div/table") %>%
map(html_table, fill = TRUE) %>%
map_df( ~ mutate(., `Year Debuted` = as.character(`Year Debuted`))) %>%
mutate(`Char_Team` = coalesce(`Character / Team / Series`, `Character / Team`)) %>%
select(Char_Team, Year_Debut = `Year Debuted`) %>%
@tjmahr
tjmahr / snippet.txt
Last active July 13, 2018 15:32
bookdown figure snippet
snippet bdfig
Figure \@ref(fig:${1:chunk-name}) ${0}
(ref:${1:chunk-name}) Text reference for caption
```{r ${1:chunk-name}, fig.cap = "(ref:${1:chunk-name})"}
```
---
title: "Untitled"
author: "Brandon Hurr"
date: "4/18/2018"
output:
beamer_presentation:
latex_engine: xelatex
---
```{r setup, include=FALSE}
@yannabraham
yannabraham / beanplots.R
Created July 16, 2012 09:31
ggplot2 BeanPlots
## reproduce the figures from http://www.jstatsoft.org/v28/c01/paper using ggplot2
library(ggplot2)
## parameters
set.seed(2710)
## Figure 1
d <- rnorm(50)
tap 'homebrew/fuse'
tap 'homebrew/dupes'
tap 'homebrew/cask'
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'homebrew/cask-drivers'
cask_args appdir: '/Applications'
brew 'ack'