zondag 17 februari 2019

GUI for R ggplot

In data journalism training I often use Tableau to make visualizations. Fast and easy. However sometimes we do analysis of data not in Excel but using Rstats. Plotting data with ggplot is not so easy, because of the variables you have to define.

Now there is a new package 'esquisse' (sketch) , based on Shiny, that works as a GUI for ggplot2. Install the package and start the GUI for ggplot from the addin menu or from the console: esquisse::esquisser  Don't tag the package. Select a data file. In the example below I use GDP and life expectancy for Sub Sahara African countries. At the bottom line you can do fine tuning for labels, colors and theme, select data and export the plot.
See for example my static blog using R blogdown:
https://d3media.netlify.com/post/export-code-from-esquisse-for-ggplot/













maandag 11 februari 2019

Write your blogs in R STUDIO with Markdown

You are working in R and want to show or export your code? Simple we use R markdown. Create a markdown - Rmd - doc with your code and comments. Then export the Rmd with Knit to Word, Pdf or html.
Publishing your R Code directly is not complicated using the new package blogdown. Blogdown is an effort to integrate R markdown with open source static web generators like Hugo. To deploy your blog  with the Rmarkdown use Netlify, a platform for managing and deploying modern web projects.
Below is the workflow.


maandag 4 februari 2019

De de-kolonisatie van het internet

Habermas zou misschien glimlachend hebben meegeluisterd.  Vorige maand organiseerde Meetup Arhem in Villa Sonsbeek een discussieavond onder de titel”Het internet is stuk”.   Geert-Jan Bogaerts, hoofd digitaal van de VPRO, presenteerde hier het plan PublicSpaces. PublicSpaces verzet tegen de kolonisering van het internet door de digitale grootmachten: Facebook, Google etc. Een soort “Strukturwandel der Öffentlichkeit”, maar dan digitaal. Immers in het begin was het internet een open en decentrale ruimte die vergezichten opriep van vrijheid en discussie;  een “electronic town hall” vergelijkbaar met de Atheense democratie schreef Al Gore.  Nu is het internet stuk.

zondag 3 februari 2019

TWO TRENDS IN DATA JOURNALISM

In this blog post I am trying to synthesize my thinking about tools and developments in data journalism.

Data journalism is getting easier. Writing difficult formulas in Excel or doing  a database join in order to make a map in Google Fusion Tables is over.  The last years new software is developed and available to do data journalism. Every reporter and editor should be able to work with these new web based services for reporting data stories. Data wrapper is already a classic, but Workbenchdata and Flourish are new easy use tools.

R Project
The digging deeper in data and visualizing complicated relationships need another approach. R project is an interesting candidate, and there are good reasons to use R in journalism. Two British media, the Economist and the BBC have published data journalism stories based on R. At Birmingham City University is Paul Bradshaw training journalism students in an MA for these job in R and coding.
So there is an movement into the opposite direction. Data journalism is getting more complicated by  integrating skills and tools of computer science and statistical analysis.

Economist
The Big Mac index by the Economist is a nice example. This index tries to establish whether  currencies are over or undervalued. The data and the calculations in R for the Big Mac index are published  at Github  as a Jupyter Notebook .

BBC
The BBC got also into R especially for making graphs with ggplot and the need for standardization of that production. Datajournalists at the BBC developed their own package in R to do the work called bbplot. Every R user can install this package and start producing graphs the BBC way. Working with R is not self evident and beginners need some help. That is the cookbook of the BBC , with recipes for various graphs from line to bar or scatter diagrams.
It is remarkable when the BBC writes: “We don’t use it for interactive graphics, for which the Javascript library D3 is better suited….or static charts we’ve found R and ggplot2 to be very useful”. D3 is a good choose, but you need java script and the D3 library to do that work which something completely different. I think it would be easier to use plotly for exporting ggplots, or use R's Shiny server for interactive graphs.

I am quite enthusiastic about this development in data journalism. In times of diseases like fake news and Facebook manipulation is fact-based reporting the only medicine.

woensdag 16 januari 2019

Mirror Android Phone on Linux

Getting you Android phone connected to a Linux box is not so difficult; install and run adb (android developers bridge) to swap files. Mirroring and controlling the device is a bit more difficult. Using scrcpy makes it possible.
How does that work? scrcpy installs a server on your phone and communicates with the Linux box over adb. This server sends a video stream to the  Linux box; all input (mouse and keyboard) events are captured, which makes interaction with the phone easy.
For installing scrcpy there are to possibilities:
- build the app manually;
- run a docker image

donderdag 10 januari 2019

THE INTERNET IS BROKEN AND FACEBOOK HOLDS THE SMOKING GUN


The central conclusion from the documentary the Facebook Dilemma, that was recently broad-casted on TV, is that Facebook was too late and too slow in handling fake news, hate speech and fake accounts, manipulation and social conflict. It is interesting to see how Mark Zuckerburg defends his company by saying that Facebook is a tech company aiming at bringing people together. As a tech company Facebook/Zuckerburg pretends that tech tools will deliver the solutions for all, social and political, problems created by Facebook. The parallel with the movie about the creation of Facebook-The Social Network- is obvious. In that movie Zuckerberg, then a clumsy geek at Havard, created a computer program  for rating female students, hacking the database of the university. Perhaps compensating his own lack of social skills to get in touch with female students.

Media Company
The problem is that Facebook is not a tech company but a media company. Controlling the flow of news and information on Facebook is only possible by understanding the role of media in a democracy. At traditional media this role is in the hands of editors who check and filter the news before it is published. Facebook still not admitting they are media, hired thousands of censors checking the flow of information based on key words. Probably in the end aiming at complete automation by algorithm. I don't believe this will work for more than 2,5 billion users on world scale. Is too large and the social and political problems in all corners of the world are too complicated to handle by keyword searching censors. The best solution would be to break up Facebook in different sub-media for example by regions or by topic and in these sub-media the editors play a central role.
Secondly if Facebook acknowledges that they are a media company then they would be controlled by media law and can be hold responsible for publication. Now they escape this type responsibility and control by rules of freedom of speech.
The problems related to the content of Facebook, originate in the business model of Facebook and the design of internet. 

dinsdag 8 januari 2019

RETRO-PLAYTIME 2

it is still holiday, so I play around a bit.... found some retro games from the nineties deep in desk drawer: Day of the Tentacle and Myst; these were the first interactive video games published in the nineties. My children loved playing with these games. But can you revive them?  Installing Win95 in a virtual box is a bot complicated. I discovered scummvm . Install it on a Linux box or a windows machine, and just play:

Myst caused some trouble because copying the data failed, probably some protection.....
Oh, even more convenient, play on a phone or tablet and get scummvm from the google app store.