Skip to content

Instantly share code, notes, and snippets.

police <- police[!grep("total",Result)][`Major Category` != "All"][,!c("Total.2012/13","Total.2011/12"),with=FALSE]
police <- gather(police, key, number, -Result, -`Major Category`)
police <- separate(police, key, into=c("Complaint", "Year"), sep="\\.")
police[,Result := factor(Result, levels = unique(police$Result))]
@gfrmin
gfrmin / keybase.md
Last active November 8, 2022 09:30

Keybase proof

I hereby claim:

  • I am gfrmin on github.
  • I am guyfreeman (https://keybase.io/guyfreeman) on keybase.
  • I have a public key ASC-_OTZH1t8VPzsjsVmJr2esFWbltwsW-rICByw8eQEFQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am slygent on github.
  • I am guyfreeman (https://keybase.io/guyfreeman) on keybase.
  • I have a public key whose fingerprint is AAC6 8708 86D7 7CCB 632E D2B1 7043 883A 2F9C D492

To claim this, I am signing this object:

library(reshape2)
library(ggplot2)
library(data.table)
library(scales)
infmor <- read.csv("2.csv")
infmor <- melt(infmor, id.vars = "year")
infmorplot <- ggplot() + geom_line(data = infmor, mapping = aes(x = year, y = value, colour = variable, group = variable)) + labs(x = "Year", y = "Infant mortality per 1000 births") + scale_x_continuous(limits = c(1950, 2020)) + theme_bw()
ggsave(filename = "popplot.png", plot = popplot)
@gfrmin
gfrmin / 1.R
Last active December 24, 2015 12:19
1.R
library(reshape2)
library(ggplot2)
library(data.table)
library(scales)
pop <- read.csv("T01_01_01A.csv", sep="\t")
colnames(pop) <- c("age", "sex", "1981", "1986", "1991", "1996", "2001", "2006", "2010", "2011", "2012")
pop <- melt(pop)
colnames(pop)[3] <- "year"
pop <- data.table(pop)