Making Graphs of DW Stats

From Dreamwidth Notes
Jump to: navigation, search

So, right now [info]foxfirefey has DW stats automatically downloaded and archived here:

Since the text files don't get updated, [info]sophie make a pipeline command that will make a CSV file of the HTML pages.

That can be used in Excel or R to make a graph of statistics:


linecolors = c("navyblue", "blue", "skyblue2", "red")
linelabels = c("Active", "Updated in last 30 days", "Updated in last 7 days", "Updated in last 24 hours")

dwstats <- read.csv(file="stats.csv")
zoodwstats <- zoo(dwstats[,2:5], as.Date(as.character(dwstats[,1])))

onefile = TRUE

pdf(file=ifelse(onefile, "DWStatsGraph.pdf", "none"), width=12, height=8, title="Dreamwidth Stats")
plot(zoodwstats, main="Activity Statistics for Dreamwidth", plot.type="single", col=linecolors, xlab="Date", ylab="Number of accounts")
legend(x="topleft", linelabels, xjust=0.5, fill=linecolors, ncol=2, inset=0.2, title="Key")