Alex and I had a great time in Albacete this summer, where the annual useR! conference took place. Of course we were really interested in the exciting news on R development, new packages and other related topics that we hoped to hear about there, and we also wanted to present what we have created with our R packages and rapporter.net beside socializing and to meet some guys from SO and GH in real life at last, but I also really expected to meet some other Hungarian guys at the conference.
It turned out that I was the only attendant from Hungary – except for Szilárd Pafka, who has been living in the USA for a long time, so he does not really count by the strict standard 🙂 Since then, I know that there are a lot more R users living in Hungary, but I’ve just had the chance to verify my feeling that the number of attendees from East-Europe was rather low – as the official list of attendants has been recently published at the homepage of the conference:
> d <- readHTMLTable('http://www.edii.uclm.es/~useR-2013/asistentes.html', which = 1, stringsAsFactors = FALSE)
That looks like:
> pander(table(d[, 2]), split.table = Inf)
Converted to HMTL:
|Australia||Austria||Bangladesh||Belgium||Canada||Czech Republic||Denmark||Estonia||Finland||France||Germany||Hungary||Iran||Ireland||Israel||Italy||Japan||Korea||Latvia||Mexico||New Zealand||Norway||Poland||Portugal||Russia||Serbia||Singapore||Slovenia||South Africa||South Korea||Spain||Sweden||Switzerland||Taiwan||The Netherlands||Turkey||United Kingdom||United States||USA|
Well, it really seems that I was the only guy from Hungary, but at least Polish users were a lot more active from this region. Anyway, this list could use some cleaning and finishing touches with the help of e.g. the
> names(d) <- gsub(' ', '', names(d))
> d$COUNTRY[which(is.na(countrycode(d$COUNTRY, 'country.name', 'iso2c')))]
 "England" "" "Letonia" "Madrid"
It seems that there are some unidentified countries and even a missing one, let’s fix that (with some desktop research):
> d$COUNTRY[which(d$COUNTRY == 'England')] <- 'United Kingdom'
> d$COUNTRY[which(d$COUNTRY == 'Letonia')] <- 'Latvia'
> d$COUNTRY[which(d$COUNTRY == 'Madrid')] <- 'Spain'
> d$COUNTRY[which(d$NAME == 'Yurii Aulchenko')] <- 'The Netherlands'
Much better! And I really hope that my guess was right about Yurii.
As I really liked the “Where is the R Activity?” post and found it extremely inspiring, I was also thinking about reproducing that kind of plot based on this data set. After fetching and loading the world map referenced in the article and aggregated our cleaned data, I have also created a new country ID variable in the aggregated dataset so that we could easily merge that to the shape file:
> ## aggregate
> d$flag <- 1
> counts <- aggregate(d$flag, by = list(d$COUNTRY), sum)
> names(counts) <- c("country.name", "count")
> ## std name
> counts$COUNTRY <- countrycode(counts$country.name, 'country.name', 'iso2c')
Merging, magic and plotting was done just like in the original article:
Just cannot wait to render a similar cartogram next year!