Publications by Rolf Fredheim
Polarisation and Mobilisation indicators
This blog post makes available a set of indicators discussed in a forthcoming edition of Digital Icons. In brief, the script takes a text input and calculates polarisation and mobilisation indexes based on the number of pronouns featured.The hypothesised relationship between pronouns and polarisation is one discussed extensively by critical disco...
4920 sym 2 img
Wikipedia page views
Here I present an application that quantifies Wikipedia page views. It can visualise any topic in any language. It is (shamelessly) based on an application by the blogger Andrew Clark (pssguy), whose code is available here.I have added:multi language supporta moving average optiona regression option (on this see below)Especially the regression ...
3158 sym 2 img
Dynamically annotate graphs with Shiny
Below I present a simple way to automatically annotate plots through Shiny It occurred to me that labeling plots should be really easy to do with R-studio’s swanky ‘Shiny’ add on. To test this I gathered some time series data from Wikipedia, added options for the number of points to be labelled, either by date or by view count. I also quic...
1468 sym 2 img
R and foreign characters
Working with Russian characters can be mind-numbingly frustrating. This is true for R, as for other applications, so below I've written out the my top five tricks for making Russian inputs work in R; i believe they should be transferable to most other languages. Having forced any number of programs to accept Russian characters in the past, I hav...
3451 sym R (298 sym/5 pcs) 2 img
Modelling memory and news trajectories
Modelling memory In the text below I present two models I've made to quantify and visualise the diverging trajectories of memory and news events, and conclude that linear regression may be used to test which model best describes the story. First, though, I contextualise this with an illustration from the Russian media landscape. In recent years ...
11384 sym R (2108 sym/3 pcs) 12 img
Better modelling and visualisation of newspaper count data
In this post I outline how count data may be modelled using a negative binomial distribution in order to more accurately present trends in time series count data than using linear methods. I also show how to use ANOVA to identify the point at which one model gains explanatory power, and how confidence intervals may be calculated and plotted arou...
4513 sym R (2601 sym/6 pcs) 4 img
plot textual differences in Shiny
Wordclouds such as Wordle are pretty rubbish, so I thought I’d try to make a better one, one that actually produces (statistically) meaningful results. I was so happy with the outcome I decided to make it interactive, so go on, have a play!Compare any two files texts (turns out file uploading in Shiny is pretty experimental/dysfunctional) , an...
2547 sym 2 img
Reproducible research with R, Knitr, Pandoc and Word
Add references and a style sheet Below I briefly outline why Pandoc is an essential part of my research workflow, and demonstrate how to seamlessly integrate it with a bibliographic system and code written in R to produce high quality word or pdf documents. I also include all the functions needed to get this working fast.Knitr is great. I'm writi...
4270 sym R (795 sym/4 pcs)
Mapping the GDELT data (and some Russian protests, too)
In this post I show how to select relevant bits of the GDELT data in R and present some introductory ideas about how to visualise it as a network map. I've included all the code used to generate the illustrations. Because of this, if you here for the shiny visualisations, you'll have to scroll way down The Guardian recently published an article ...
6877 sym R (8008 sym/8 pcs) 12 img
big geo-data visualisations
Spotting international conflict is very easy with the GDELT data set, combined with ggplot and R. The simple gif above shows snapshots of Russian/Soviet activity from January 1980 and January 2000. I think it also illustrates how Russia nowadays looks more to the east and the South than during the Cold War. The trend, though not very strong above...
8358 sym 10 img