Wordcloud of conference abstracts – FOSS4G Edinburgh

I’m helping run a conference this September – FOSS4GUK. To help promote the event I’ve created a wordcloud of conference abstracts, in R!

abstract_wordcloud_logo

The conference is taking place in Edinburgh, Scotland at Dynamic Earth. It’s focused on free and open source software for geospatial (FOSS4G), as such is full stack. Everything from backend databases, ETL, analysis to web publication. Tools featured include QGIS, R, Python, PostGIS, leaflet and many others.

Tickets: https://uk.osgeo.org/foss4guk2019/

Follow on twitter: https://twitter.com/foss4guk

Back to the wordcloud. Working with plain text files, I followed Julia and David’s excellent instructions and then added decoration in GIMP. R script below.

<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;">&#65279;</span>
library(tidyverse)
library(tidytext)
library(wordcloud)

# ----------------------------

data("stop_words")

f = list.files("~/dir/dir")
abstracts = lapply(f, function(i){
   read_table(paste0("~/dir/dir/", i),
              col_names = F) %&gt;%
      gather(key, word) %&gt;%
      select(-key) %&gt;%
      add_column(author = str_remove(i, ".txt")) %&gt;%
      unnest_tokens(word, word) %&gt;%
      anti_join(stop_words)
})
abstracts = do.call("rbind.data.frame", abstracts)

png("~/dir/dir/abstract_wordcloud.png",
    width=1200, height=800, res=150)
par(mar = rep(0, 4))
abstracts %&gt;%
   drop_na() %&gt;%
   filter(!str_detect(word, "[0-9]") &amp;
             word != "e.g") %&gt;%
   count(word) %&gt;%
   with(wordcloud(word, n,
                  random.order = FALSE,
                  max.words = 150,
                  colors = c("#497fbf", "#f49835"),
                  rot.per = 0, fixed.asp = F))
dev.off()

Advertisements