I hereby claim:
- I am aammd on github.
- I am aammd (https://keybase.io/aammd) on keybase.
- I have a public key ASAjkSpXgWkiID1aVIJksW_plP1S60NKHq3lnNrdFeLD8wo
To claim this, I am signing this object:
library(brms) | |
library(tidyverse) | |
# we're going to have 5 animals | |
nspp <- 5 | |
# in 100 sites | |
nsites <- 100 | |
#abilities are between -1 and 1, from a normal distribution: | |
thetas <- rnorm(nspp, 0, 1.2) |
#!/bin/bash | |
# Usage: mkproj [projectname] | |
# projectname defaults to name of current directory | |
template="Version: 1.0\nRestoreWorkspace: Default\nSaveWorkspace: Default\nAlwaysSaveHistory: Default\n\nEnableCodeIndexing: Yes\nUseSpacesForTab: Yes\nNumSpacesForTab: 4\nEncoding: UTF-8\n\nRnwWeave: knitr\nLaTeX: pdfLaTeX" | |
wd=$(basename `pwd`) | |
if [ -z $1 ]; then |
library(pageviews) | |
require(lubridate) | |
today <- pageview_timestamps() | |
earlysept <- pageview_timestamps(lubridate::ymd("2017-09-01")) | |
korsmit <- pageviews::article_pageviews("en.wikipedia", "Roy_Kortsmit", start = earlysept, end = today) | |
korsmit %>% | |
ggplot(aes(x = date, y = views)) + theme_minimal() + geom_line() + geom_point() + | |
labs(title = "Roy Kortsmit wikipedia pageviews", subtitle = "Before and after he made 4 saves in 5s.") |
I hereby claim:
To claim this, I am signing this object:
rmax <- function(rm, baserate){ | |
force(rm) | |
force(baserate) | |
function(x) { | |
rm * x / ( | |
(rm / baserate) + x | |
) | |
} | |
} |
BEGIN { | |
fam = 0 | |
parasite_genus = 0 | |
host_genus = 0 | |
parasite_species = 0 | |
print "Host_fam\tHost_genus\tHost_sp\tParasite_genus\tParasite_sp\tk_i\tLocation\tParasite_fam" | |
} | |
/^[A-Z]/ {fam = $1} | |
/^\t[A-Z]/ { |
library(dplyr) | |
library(tidyr) | |
library(stringr) | |
too_wide <- frame_data( | |
~common_name, ~plant_genera, | |
"Abagrotis apposita", "Amelanchier Arbutus Cenanothus", | |
"Abagrotis brunipennis", "Prunus Vaccinium" | |
) |
library(dplyr) | |
library(ggplot2) | |
data_frame(x = seq(2001, 2016, by = 2), | |
y = exp(rnorm(length(x), mean = 0.3, sd = 0.03)*(x - 2000))) %>% | |
ggplot(aes(x = x, y = y)) + geom_point() + geom_line() + | |
labs(x = "Year", | |
y = "Cumulative number of papers", | |
title = "Number of papers with a 'Number of papers' figure") + | |
theme_bw() |
library(dplyr) | |
library(igraph) | |
library(ggplot2) | |
library(ggraph) | |
ed <- frame_data( | |
~from, ~to, | |
"a", "b", | |
"a", "c", | |
"c", "e" |
microbenchmark::microbenchmark({lm(ys~xs, data = testdf)$residuals}, | |
{fastLm(ys~xs, data = testdf)$residuals}, | |
{homemade_residuals(indeps, deps)}, times = 500) | |
identical(homemade_residuals(indeps, deps), homemade_residuals2(indeps, deps)) | |
# all.equal() | |
testdf <- data_frame(xs = runif(200, 0, 15), | |
ys = xs * 5 + 15 + rnorm(200, sd = 3)) |