I hereby claim:
- I am apreshill on github.
- I am alisonhill (https://keybase.io/alisonhill) on keybase.
- I have a public key ASCucGQ8iaHYozuOw_4ZGI0JRFMRU-hq2paVGj_nlW35eQo
To claim this, I am signing this object:
site | total | n_asd | prevalence_1000 | data_source | l95_1000 | u95_1000 | year_survey | year_pub | birth_cohort | table | for_line | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Alabama | 36566 | 174 | 4.8 | ho | 4.1 | 5.5 | 2008 | 2012 | 2000 | 2 | 1 | |
Arizona | 32601 | 507 | 15.6 | eh | 14.3 | 17 | 2008 | 2012 | 2000 | 2 | 1 | |
Arkansas | 4940 | 52 | 10.5 | eh | 8 | 13.8 | 2008 | 2012 | 2000 | 2 | 1 | |
Colorado | 7725 | 91 | 11.8 | eh | 9.6 | 14.5 | 2008 | 2012 | 2000 | 2 | 0 | |
Colorado | 29336 | 188 | 6.4 | ho | 5.6 | 7.4 | 2008 | 2012 | 2000 | 2 | 1 | |
Florida | 29366 | 211 | 7.2 | ho | 6.3 | 8.2 | 2008 | 2012 | 2000 | 2 | 1 | |
Georgia | 50427 | 601 | 11.9 | eh | 11 | 12.9 | 2008 | 2012 | 2000 | 2 | 1 | |
Maryland | 27022 | 336 | 12.4 | eh | 11.2 | 13.8 | 2008 | 2012 | 2000 | 2 | 1 | |
Missouri | 25668 | 357 | 13.9 | ho | 12.5 | 15.4 | 2008 | 2012 | 2000 | 2 | 1 |
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 |
# convert all column names to snake case | |
# make all column names lower case | |
# replace all . with _ | |
names2snake <- function(data){ | |
require(stringr) | |
require(dplyr) | |
names(data) = names(data) %>% | |
tolower() %>% | |
str_replace_all(., "[.]", "_") | |
data |
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
Thanks to Hilary Parker for the easy breezy template! | |
https://gist.github.com/hilaryparker/046f55f5222b12692d74 | |
#load packages | |
library(babynames) | |
library(dplyr) | |
library(ggplot2) | |
library(grid) | |
library(wesanderson) |
tap 'homebrew/cask' | |
tap 'homebrew/cask-fonts' | |
tap 'homebrew/cask-versions' | |
tap 'homebrew/cask-drivers' | |
cask_args appdir: '/Applications' | |
# Version Control | |
brew 'git', args: ['with-persistent-https', | |
'with-curl', |
# Create a GitHub PAT | |
# Hint: use the usethis package | |
# see: http://happygitwithr.com/github-pat.html#step-by-step | |
library(usethis) | |
browse_github_pat() # takes you to browser | |
# Add it to .Renviron | |
# Hint: use the usethis package | |
edit_r_environ() # makes the file if not yet made- needs blank line at end! | |
# now copy/paste long PAT with = sign |
library(tidyverse) | |
msleep <- msleep %>% | |
select(name:order) | |
msleep | |
msleep %>% | |
add_count(vore) %>% # n = vores | |
count(vore, order, n) %>% # nn = unique orders per vore |
I hereby claim:
To claim this, I am signing this object:
library(tidyverse) | |
set.seed(1000) | |
asdpop_base <- tibble::tibble( | |
time1 = sample(1:100, 100, replace = F), | |
time2 = time1) %>% | |
tidyr::gather(x, y, time1:time2, factor_key = TRUE) | |
asdpop <- asdpop_base %>% | |
mutate(services = as.factor(case_when( | |
x == "time1" & y <= 30 ~ 1, |