Skip to content
This repository
branch: crowdometer
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 27 lines (21 sloc) 1.122 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# Analysis of crowdometer results: tweets by author/publisher of paper
# Version 1.0, 02/19/12
# by Martin Fenner <fenner.martin@mh-hannover.de>

# Import crowdometer result set from figshare
#tweets <- read.csv("http://figshare.com/media/download/97336/89546", sep=",")
classifications <- read.csv("http://figshare.com/media/download/97336/89547", sep=",")

# Combine classifications with tweets, using max value. This will return true
# if at least 50% of classifications are true
results <- unstack(classifications, form=shares_author~tweet_id)
results <- lapply(results, max)

# Get a vector of the results, turn into table that counts all results
results <- table(unlist(results, use.names=FALSE))

# Subtitle
piesubtitle <- sprintf("%3.0f Tweets", sum(results))

# Create label
pielabels <- sprintf("%s (%2.0f%s)", names(results), 100*results/sum(results), "%")

# Do the plotting
opar <- par(mar=c(2,2,2,2), cex.sub=0.8, cex.main=1.4, fg="black", col.main="#25679a")
pie(results, labels=pielabels, init.angle=130, cex=0.8, lty=1)
title(main="Tweets by Author/Publisher of Paper", sub=piesubtitle, line=-1)
par(opar)
Something went wrong with that request. Please try again.