This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install these packages if you don't have them | |
library(dplyr) | |
library(tidyr) | |
library(ggplot2) | |
library(elo) | |
library(ggrepel) | |
'%!in%' <- function(x,y)!('%in%'(x,y)) | |
# babynames <- read.csv("data/national.csv", header = TRUE, stringsAsFactors = FALSE) # From SS admin download | |
babynames <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-03-22/babynames.csv') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start with all Lepidoptera museum records from | |
# Boyle, J., H. Dalgleish, and J. Puzey. 2019a. | |
# Data from: Monarch butterfly and milkweed declines substantially predate | |
# the use of genetically modified crops. Dryad Digital Repository. | |
# https://datadryad.org/resource/doi:10.5061/dryad.sk37gd2 | |
# these data were downloaded, cleaned, and saved with code provided in Dryad: | |
# PART 1.1 Filtering museum data.R | |
lep <- readRDS("lep_records.rds") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# maps of my Strava data | |
# code modified from Xavi Gimenez | |
# http://www.xavigimenez.net/blog/2015/04/mapping-3-years-of-running-workouts/ | |
library(plotKML) | |
library(ggplot2) | |
library(ggmap) | |
library(stringr) | |
library(lubridate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to @greghirson who totally knocked this out of the park! | |
# Based on his work, here's a simple script to pull monthly prices from the USDA NASS website. | |
library(RCurl) | |
library(XML) | |
x <- postForm(uri = "http://quickstats.nass.usda.gov/uuid/encode", | |
source_desc = "SURVEY", sector_desc="CROPS", | |
group_desc="FIELD CROPS", commodity_desc="CORN", | |
statisticcat_desc="PRICE RECEIVED", |