Articles by R on datawookie

Survey Raking: An Illustration

December 25, 2018 | R on datawookie

Analysing survey data can be tricky. There’s often a mismatch between the characteristics of the survey respondents and and those of the general population. If the discrepancies are not accounted for then the survey results can (and generally will!) be misleading. A common approach to this problem is to ...
[Read more...]

Installing RStudio & Shiny Servers

November 12, 2018 | R on datawookie

I did a remote install of Ubuntu Server today. This was somewhat novel because it’s the first time that I have not had physical access to the machine I was installing on. The server install went very smoothly indeed. The next tasks were to install RStudio Server and Shiny ... [Read more...]

Diagnosing RStudio Startup Issues

September 6, 2018 | R on datawookie

Yesterday I tried to start RStudio and something weird happened: the window launched but it was blank and unresponsive. I tried dpkg --remove and then re-installed. Same problem. I tried dpkg --remove followed by dpkg --purge and then re-installed. S... [Read more...]

Updating R on Ubuntu

July 8, 2018 | R on datawookie

Today I finally got around to updating my R to 3.5 (or, more specifically, 3.5.1). The complete instructions for doing the update on Ubuntu are available here. I’ve paraphrased them below. Authentication Key To ensure the integrity of files, add the appropriate public key to your system. You may have already ... [Read more...]

eRum (2018) Top Twenty

May 17, 2018 | R on datawookie

My Top 20 highlights about eRum (2018) in Budapest. In no particular order: Returning to my favourite European city after so many years. Discovering the cheap and efficient bus 100E, which shuttles back and forth between the airport and city. I have previously only made this trip by car. Partial support from ...
[Read more...]

Travelling Salesman with ggmap

May 10, 2018 | R on datawookie

I’ve been testing out some ideas around the Travelling Salesman Problem using TSP and ggmap. For illustration I’ll find the optimal route between the following addresses:
ADDRESSES <span>=</span> <span>c</span><span>(</span>
  <span>"115 St Andrew's Drive, Durban North, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"1 Evans Road, Glenwood, Berea, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"7 Radar Drive, Durban North, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"25 Gainsborough Drive, Durban North, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"77 Armstrong Avenue, Umhlanga, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"255 Musgrave Road, Berea, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"11 Cassia Road, Reservoir Hills, Durban, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"98 Shepstone Road, Berkshire Downs, New Germany, KwaZulu-Natal, South Africa"</span><span>,</span>
  <span>"12 Finchley Road, Berea West, Westville, KwaZulu-Natal, South Africa"</span>
<span>)</span>
Load up some packages.
<span>library</span><span>(</span>dplyr<span>)</span>
<span>library</span><span>(</span>ggmap<span>)</span>
<span>library</span><span>(</span>gmapsdistance<span>)</span>
<span>library</span><span>(</span>TSP<span>)</span>
Geocoding I added the latitude and longitude for each address using the handy ggmap::mutate_geocode(). ...
[Read more...]

Classification: Get the Balance Right

April 20, 2018 | R on datawookie

For classification problems the positive class (which is what you’re normally trying to predict) is often sparsely represented in the data. Unless you do something to address this imbalance then your classifier is likely to be rather underwhelming. Achieving a reasonable balance in the proportions of the target classes ...
[Read more...]

Tips for Lightning Talks

April 6, 2018 | R on datawookie

It seems a little counter-intuitive, but a 5 minute lightning talk is far more difficult to prepare (and present!) than a standard 20 minute or longer talk. The principle challenge is fitting everything that you want to say into the allotted time, while still maintaining an engaging narrative. At the recent satRday ... [Read more...]

Installing rJava on Ubuntu

February 5, 2018 | R on datawookie

Installing the rJava package on Ubuntu is not quite as simple as most other R packages. Some quick notes on how to do it. Install the Java Runtime Environment (JRE). sudo apt-get install -y default-jre Install the Java Development Kit (JDK). sudo apt-get install -y default-jdk Update where R expects ... [Read more...]

Analysis of Feedback from satRday [Cape Town] 2017

November 14, 2017 | R on datawookie

We recently announced the second satRday (Cape Town) conference scheduled to take place on 17 March 2018. Obviously we want this to be bigger and better than this year’s event, so we are paying careful attention to the feedback that we received from the first event. This is a quick analysis ...
[Read more...]

Durban Twitter Analysis

November 10, 2017 | R on datawookie

I was invited to give a talk at Digifest (Durban University of Technology) on 10 November 2017. Looking at the other speakers and talks on the programme I realised that my normal range of topics would not be suitable. I needed to do something more in line with their mission to “celebrate ...
[Read more...]

Hosting a Plumber API on AWS

September 13, 2017 | R on datawookie

I’ve been putting together a small proof-of-concept API using R and plumber. It works flawlessly on my local machine and I was planning on deploying it on an EC2 instance to demo it for a client. However, I ran into a snag: despite opening the required port in my ...
[Read more...]

Building a Local OSRM Instance

September 11, 2017 | R on datawookie

The Open Source Routing Machine (OSRM) is a library for calculating routes, distances and travel times between spatial locations. It can be accessed via either an HTTP or C++ API. Since it’s open source you can also install locally, download appropriate map data and start making efficient travel calculations. ...
[Read more...]

Global Variables in R Packages

September 7, 2017 | R on datawookie

I know that global variables are from the Devil, but sometimes you just can’t get around them. I’m building a small package for a client that relies on a data file. For various reasons that file is not part of the package and can reside in different locations ... [Read more...]

Route Asymmetry in Google Maps

August 22, 2017 | R on datawookie

I have been retrieving some route information using Rodrigo Azuero’s gmapsdistance package and noted that there was some asymmetry in the results: the time and distance for the trip from A to B was not necessarily always the same as the time and distance for the trip from B ...
[Read more...]

A Timeline History of R

August 4, 2017 | R on datawookie

A record of some more or less important events in the history of R. This is a work in progress. The information is cobbled together from a range of sources. If you have pertinent items to add, please let me know via the comments. 2020: useR! (... [Read more...]

Favourite Talks from useR 2017

July 22, 2017 | R on datawookie

Geospatial RQGIS: Integrating R with QGIS for Innovative Geocomputing (Jannes Muenchow) Exploring and presenting maps with tmap (Martijn Tennekes) Maps are data, so why plot data on a map? (Mark Padgham) Geospatial Visualization using R (Bhaskar V. Karambelkar) Spatial Data in R: New Directions (Edzer Pebesma) mapedit - interactive manipulation ... [Read more...]
1 2 3

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)