Data Science Austria

Visualizing Language Loss in Taiwan: Create an “Age-Sex Pyramid of Language” with ggplot2

Taiwan Language Survey is a small project I worked on during May to June in 2018. The idea was to create a survey that continuously collects data and a web page that visualizes the collected data. The web page is updated weekly using Travis-CI. The main purpose of this survey … Read moreVisualizing Language Loss in Taiwan: Create an “Age-Sex Pyramid of Language” with ggplot2

Verbose data.table and uncovering hidden cedta’s data table awareness decisions

When speed and memory efficiency is important, the data.table package is one of the ways to improve those aspects of our R code dramatically. Including data.table in a package also comes with the added benefit of only importing the methods package, which is part of base R. We must also … Read moreVerbose data.table and uncovering hidden cedta’s data table awareness decisions

Weather Forecast from MET Office

This is another function I wrote to access the MET office API and obtain a 5-day ahead weather forecast: METDataDownload <- function(stationID, product, key){library(“RJSONIO”) #Load Librarylibrary(“plyr”)library(“dplyr”)library(“lubridate”)connectStr <- paste0(“http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/”,stationID,”?res=”,product,”&key=”,key)con <- url(connectStr)data.json <- fromJSON(paste(readLines(con), collapse=””))close(con)#StationLocID <- data.json$SiteRep$DV$Location$`i`LocName <- data.json$SiteRep$DV$Location$nameCountry <- data.json$SiteRep$DV$Location$countryLat <- data.json$SiteRep$DV$Location$latLon <- data.json$SiteRep$DV$Location$lonElev <- data.json$SiteRep$DV$Location$elevationDetails <- data.frame(LocationID = LocID,LocationName = … Read moreWeather Forecast from MET Office

Geocoding function

This is a very simple function to perform geocoding using the Google Maps API: getGeoCode <- function(gcStr, key) {library(“RJSONIO”) #Load LibrarygcStr <- gsub(‘ ‘,’%20’,gcStr) #Encode URL Parameters#Open ConnectionconnectStr <- paste0(‘https://maps.googleapis.com/maps/api/geocode/json?address=’,gcStr, “&key=”,key) con <- url(connectStr)data.json <- fromJSON(paste(readLines(con), collapse=””))close(con)#Flatten the received JSONdata.json <- unlist(data.json)if(data.json[“status”]==”OK”) {lat <- data.json[“results.geometry.location.lat”]lng <- data.json[“results.geometry.location.lng”]gcodes <- c(lat, lng)names(gcodes) … Read moreGeocoding function

Take 4+: Presentations on ‘Elements of Neural Networks and Deep Learning’ – Parts 1-8

“Lights, camera and … action – Take 4+!” This post includes  a rework of all presentation of ‘Elements of Neural Networks and Deep  Learning Parts 1-8 ‘ since my earlier presentations had some missing parts, omissions and some occasional errors. So I have re-recorded all the presentations.This series of presentation … Read moreTake 4+: Presentations on ‘Elements of Neural Networks and Deep Learning’ – Parts 1-8

Post to Mastodon from R

Mastodon is a decentralized microblogging platform. We can analyse some data and directly post our findings to a Mastodon instance. For example we can plot the different TLDs used by the Mastodon Fediverse. library(tidyverse) library(httr) library(jsonlite) library(scales) library(ggthemes) library(ggrepel) # data source url <- “https://instances.mastodon.xyz/” mastodon <- GET(paste0(url, “instances.json”)) %>% … Read morePost to Mastodon from R