committed version from plane (should be good to go)
[state_of_wikimedia_research_2013] / figures / cite_graph.R
diff --git a/figures/cite_graph.R b/figures/cite_graph.R
new file mode 100644 (file)
index 0000000..ce88e41
--- /dev/null
@@ -0,0 +1,36 @@
+# the last line is projected based on citations to the end of october
+# (almost certainly conservative)
+library(ggplot2)
+
+d <- read.csv("wikipedia_citations.txt",header=F)
+colnames(d) <- c("year", "citations")
+
+# print the total number of citations
+sum(d$citations)
+
+# generate and print a graph
+# p <- qplot(year, citations, data=d) +
+#  geom_line(colour="blue") + geom_point(colour="blue")
+
+p <- qplot(factor(year), citations, data=d, geom="bar", fill=I("darkblue"))
+p <- p + scale_x_discrete("Year") + scale_y_continuous("Number of Papers")
+
+pdf("citations_by_year.pdf", width=7.5, height=5.3)
+print(p)
+dev.off()
+
+## data from dario
+##########################################################3
+
+# import data from dario
+d <- read.csv("Wikipedia publications - Data.csv")
+
+# clean up the dates
+colnames(d)[1] <- "date"
+d <- d[,c(-9,-10)]
+d <- d[!d$date == "2013 to date",]
+d$date <- as.factor(d$date)
+
+library(reshape)
+qplot(date, value, data=melt(d), group=variable, geom="line") +
+  aes(colour=variable) + scale_y_log10()

Benjamin Mako Hill || Want to submit a patch?