ltaer: An R package for LTA's API · Shaun Khoo

Photo by Shawn Ang.

ltaer: An R package for LTA's API


Introduction

This was my submission for the final project in my course QMSS 5072 Modern Data Structures. Our task was to create an API client R package that served as a simplifying wrapper for various APIs available online. Here is the preview of the final product:

Details

I chose to work with the transportation-related APIs offered by the Land Transport Authority of Singapore. Some examples of the APIs offered include bus timings, taxi availability, and traffic accidents data. This was challenging in several ways: the APIs only returned 50 results for each call, the APIs returned JSON-formatted data, and some APIs were time-dependent and did not always return data.

Beyond the basics, I also coded wrappers for more complicated visualization functions (such as ggmap and leaflet). The motivation here was to help casual R users to easily visualize the data from the APIs, which would aid comprehension.

The R package was built using devtools and was made freely available online on GitHub. I also deployed a pkgdown website with the documentation and vignettes for users to learn how to use the R package.

You can find my website for the R package at https://shaunkhoo.github.io/ltaer/index.html.