Skip to content

Instantly share code, notes, and snippets.

View John-Brandon's full-sized avatar

John R. Brandon, PhD John-Brandon

View GitHub Profile
@John-Brandon
John-Brandon / spin_AK.R
Created August 28, 2018 18:53
Pinwheel Alaska
#!/usr/bin/env Rscript
#
# Pinwheel map of Alaska
#
# Author: John Brandon
library(tidyverse) # For data wrangling and ggplotting
library(sf) # Spatial Features
library(USAboundaries) # One of many sources for U.S. state boundaries
# EPSG:3338 [A standard Coordinate Reference System for Alaska]
@John-Brandon
John-Brandon / Tweet_Emoji.R
Last active January 21, 2017 10:28
Example of using the `emojifont` package in R.
# Testing emojis through R
# For emoji aliases, see:
# http://www.webpagefx.com/tools/emoji-cheat-sheet/
library(emojifont) # Helper emoji functions
library(twitteR) # Twitter API
library(magrittr) # Pipes %>% in R
# Set up OAuth credentials for a twitteR session -------------------------------
setup_twitter_oauth(consumer_key = "Your_api_key",
@John-Brandon
John-Brandon / input.par
Created January 13, 2016 19:24
PBR Tier System input file (2015-01-13)
MANAGEMENT PARAMETERS CASE Cet_0A
Base Case: CV_N = 0.20; R_max = 0.04; surv_freq = 4; cv_m = 0.30
# Input parameters for PBR Tier system simulations
cseed Y # Y = Yes, then provide a seed (iseed) to the random number generator; N = seed with CPU clock instead
iseed 1234 # User supplied seed for radom number generator, ignored if cseed = N
n_sims 100 # Number of simulated population trajectories
n_stocks 1 # Number of stocks (one or two)
yr_max 100 # Number of years to project over
surv_freq 4 # Interval (yrs) between abundance surveys : Wade (1998) trial 6
@John-Brandon
John-Brandon / mytheme_bw.R
Last active January 20, 2017 18:50
Create a custom black and white theme for ggplotting in R
# Create a custom black and white theme for ggplotting in R
library("ggplot2")
mytheme_bw = theme_bw() + theme(axis.title.x = element_text(size = rel(1.5), vjust = 0.0),
axis.title.y = element_text(size = rel(1.5), vjust = 1.0),
axis.text = element_text(size = rel(1.25), colour = "black"),
plot.title = element_text(size = rel(1.75)),
legend.text = element_text(size = 20),
legend.title = element_text(size = 20),
panel.grid.major = element_line(colour = "lightgray"),
panel.grid.minor.y = element_blank(),