Skip to content

Instantly share code, notes, and snippets.

View ashander's full-sized avatar

Jaime Ashander ashander

View GitHub Profile

Fisheries landings example

First you'll need to install a few packages if you don't already have them

install.packages(c("plyr", "ggplot2", "rfisheries"))

# Next load up the package
library(rfisheries)
checking build system type... i386-apple-darwin10.8.0
checking host system type... i386-apple-darwin10.8.0
checking for gcc... gcc-4.2
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.2 accepts -g... yes
@ashander
ashander / tufteknitr.Rmd
Created October 22, 2012 19:57
Example of producing Tufte latex from knitr Rmd. Use knit('tufteknitr.Rmd') in R, then mmd2pdf tufteknitr.md at command prompt.
latex input: mmd-tufte-handout-header
Title: Tufte latex from Rmd example
Base Header Level: 2
latex mode: memoir
author: Jaime Ashander
copyright: 2011 Jaime Ashander
This work is licensed under a Creative Commons License.
http://creativecommons.org/licenses/by-nc-sa/3.0/
latex input: mmd-natbib-plain
latex input: mmd-tufte-handout-begin-doc
@ashander
ashander / em3_plants.R
Created July 18, 2011 20:44
Abstracted EM applied to plant growth
data(PlantGrowth)
pg<-subset(PlantGrowth,group!='ctrl')
pg$group=factor(pg$group)
pg1= pg[pg$group=='trt1',]
pg2= pg[pg$group=='trt2',]
hist(pg$weight)
lines(density(pg1$weight), col='blue')
lines(density(pg2$weight), col='red')