Description Usage Arguments Author(s) References Examples
View source: R/mySOreputation.R
It is very easy to view a detailed account of your reputation at any
of the Stack Exchange sites by visiting http://"sitename"/reputation
(obviously substituting "sitename" for the actual site of interest, for
example, http://stackoverflow.com/reputation). However, that format
is not very user-friendly if you want to do any analysis with it. This
function parses that page into an R data.frame
.
1 | mySOreputation(rep_file)
|
rep_file |
The path to a text version of your reputation page. Windows and Linux users can copy the text on the page with select all + copy, and simply use "clipboard" instead of saving the contents to a local file. |
Paul Hiemstra provided the base parser. Built upon by Ananda Mahto.
Values for the "actions" variable determined after visiting
http://meta.stackexchange.com/a/43005/214964.
There is one value not mentioned at that page, coded as action_id ==
99
and action == Bonus
that corresponds to the bonus that a user
gets when they have above a certain reputation and are active on multiple
Stack Exchange sites.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## This is a real reputation file,
## but the "question_id" variable is
## made up.
rep_file <- system.file("soreputation.txt", package = "SOfun")
readLines(rep_file, 15)
mydf <- mySOreputation(rep_file = rep_file)
head(mydf, 15)
str(mydf)
plot(mydf$date, cumsum(mydf$rep_change))
## Not run:
library(xts)
mydfx <- xts(mydf$rep_change, mydf$date)
apply.monthly(mydfx, sum)
plot(apply.monthly(mydfx, sum))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.