Skip to content

Instantly share code, notes, and snippets.

View lucasnell's full-sized avatar

Lucas Nell lucasnell

View GitHub Profile
@lucasnell
lucasnell / .gitignore
Last active November 29, 2023 00:01 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
#'
#' This does some basic filtering of the ecoevojobs list to narrow down jobs.
#' Much of the filtering is based on two text files, one containing locations
#' to filter for (`locations.txt`), and the other for institutions to filter
#' for (`institutions.txt`).
#' Each of these have items separated by newlines.
#' For example, the top of `locations.txt` might look like this:
#' ```
#' Alabama
#'
#' Add outgroup to phylogenetic tree.
#' The tree must be ultrametric.
#'
#' `tree`: a `phylo` object
#' `taxon_name`: name of the taxon to add; should be a single string
#' `divergence` total divergence time between a species inside `tree` and the outgroup,
#' in whatever units branchlengths in `tree` are in
#'
add_outgroup <- function(tree, taxon_name, divergence) {
@lucasnell
lucasnell / quiz_plot.R
Created September 29, 2016 16:25
Plot for Bio 152 quiz question
library(ggplot2)
library(dplyr)
library(grid)
sd_before <- 10
sd_after <- 3
mean_before <- 30
mean_after <- 10
df <- data_frame(trait = rep(seq(0, 60, length.out = 100), 2)) %>%