X-Git-Url: https://projects.mako.cc/source/state_of_wikimedia_research_2013/blobdiff_plain/122dd75e45ccdfd01c795839ede755ffed1a69c2..ba6cb65ce89c04f5222e74a82c93e4f030dd16d3:/figures/cite_graph.R diff --git a/figures/cite_graph.R b/figures/cite_graph.R new file mode 100644 index 0000000..ce88e41 --- /dev/null +++ b/figures/cite_graph.R @@ -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()