Skip to content

Instantly share code, notes, and snippets.

@mgtagle
Forked from brews/plot_summary_example.R
Created October 6, 2015 20:02
Show Gist options
  • Save mgtagle/8aa49a8ca263c633606d to your computer and use it in GitHub Desktop.
Save mgtagle/8aa49a8ca263c633606d 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