Skip to content

Instantly share code, notes, and snippets.

View mbjones's full-sized avatar

Matt Jones mbjones

View GitHub Profile
@mbjones
mbjones / data_load_snippits.R
Created September 22, 2015 21:18
Demo to iterate across a directory and execute functions in R files in that directory.
#' Produces a merged foo dataset where the columns are merged from seperate data files.
#'
#' More detailed description here
#' @param datasetnums a list of the numeric datasets to be merged
#' @return the merged data frame
mergedata <- function(datasetnums) {
# Assume directory structure such as:
#data
# -- data1.R
@mbjones
mbjones / parse_adfg_harvest_data.R
Created August 31, 2015 23:55
ADFG HTML table parsing
library(XML)
library(httr)
post_url <- "http://www.adfg.alaska.gov/index.cfm?adfg=CommercialByFisherySalmon.exvesselquery"
post_body <- list(year="2014", areas= "allareas", speciesx= "allspecies", submit= "Find%20the%20Data")
html <- POST(post_url, body = post_body, encode = "form")
akcommdf_2014 <- readHTMLTable(content(html))[[1]]
#View(akcommdf_2014)
@mbjones
mbjones / keybase.md
Created December 16, 2014 21:50
Keybase Proof

Keybase proof

I hereby claim:

  • I am mbjones on github.
  • I am mbjones (https://keybase.io/mbjones) on keybase.
  • I have a public key whose fingerprint is AF42 17D9 18A4 4581 2B07 0682 6D3F 2BB3 48B5 8AF7

To claim this, I am signing this object: