Skip to content

Instantly share code, notes, and snippets.

@brews
Created October 5, 2012 16:51
Show Gist options
  • Save brews/3840943 to your computer and use it in GitHub Desktop.
Save brews/3840943 to your computer and use it in GitHub Desktop.
Plot summary for firehistory data in R
source("firehistory.R")
d <- read.fhx("17P.fhx")
# Make a copy of the data we read-in in case we fuck-up.
d.new <- d
# Reverse the level ordering for the type factor -- the plotting looks better.
d.new$rings$type <- factor(d$rings$type, levels = rev(levels(d$rings$type)))
# Plots with ggplot2
p <- ggplot(d.new$rings, aes(x = year, fill = type))
p + geom_bar() # And a plot should pop up with this command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment