Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@drjwbaker
Created July 24, 2015 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drjwbaker/3062b8069e6ace6bcf58 to your computer and use it in GitHub Desktop.
Save drjwbaker/3062b8069e6ace6bcf58 to your computer and use it in GitHub Desktop.
(Figure 4) Code, control, and making the argument in the Humanities
#loadpackages
setwd("/home/james/Documents/2015-07_BM-R/derived_data")
library(lubridate)
library(dplyr, warn.conflicts = FALSE)
library(tidyr, warn.conflicts = FALSE)
library(ggplot2)
#read data from csv
names <- read.csv("BM.csv")
#plot data
ggplot(names, aes(x = N, fill = GENDER)) +
ggtitle("A Facet Grid (log(x), by GENDER)") +
geom_histogram() +
scale_x_log10() +
facet_grid(GENDER ~ .)
#save data to file
setwd("/home/james/Documents/2015-07_BM-R/viz")
ggsave("BM_gender-grid-logx.png", width = 7, height = 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment