Skip to content

Instantly share code, notes, and snippets.

library(dplyr)
library(readr)
library(ggplot2)
library(RColorBrewer)
#read in data
a<- read_csv('./data/usa_00005.csv')
#remove Hawaii and Alaska and pick out those of working age
b<- a %>% filter(AGE>=15 & AGE<=65 & !(STATEFIP %in% c(2,15)))
library(dplyr)
library(readr)
library(ggplot2)
library(RColorBrewer)
#read in data
a<- read_csv('./data/usa_00005.csv')
#remove Hawaii and Alaska and pick out those of working age
b<- a %>% filter(AGE>=15 & AGE<=65 & !(STATEFIP %in% c(2,15)))
@r-conway
r-conway / year_race
Last active September 23, 2016 17:26
library(dplyr)
library(readr)
library(tidyr)
#enter data
a <- read_csv('./data/usa_00001.csv')
#we should remove all data from alask and hawaii
aa <- a %>% filter(!(YEAR < 1960 & STATEFIP %in% c(2,15)))
#code number for race into words using factor
@r-conway
r-conway / Book.r
Created September 16, 2016 14:33
Book Assignment
#Enter variables
titles<-c("The Waste Land", "Lord of the Flies", "Grapes of Wrath", "Pride and Prejudice", "Frankenstein", "Little Women", "Jane Eyre", "The Things they Carried", "Huckleberry Finn", "The Old Man and the Sea")
author<-c("Thomas Eliot", "William Golding", "John Steinbeck", "Jane Austen", "Mary Shelley", "Louisa May Alcott", "Charlotte Bronte", "Tim O'Brien", "Mark Twain", "Ernest Hemmingway")
pyear<-c(1922, 1954, 1939, 1813, 1818, 1868, 1847, 1990, 1884, 1952)
stock<-c(12, 4, 7, 1, 8, 9, 3, 2, 17, 5)
price<-c(5.50, 10, 12, 20, 18.50, 22, 16, 25, 8, 15)
#create dataframe
books<-data.frame(titles, author, pyear, stock, price)
program