Python style logging in R

We are increasingly using R in “operational” settings that require robust error handling and logging. In this post we describe a quick-and-dirty way to get python style multi-level log files by wrapping the futile.logger package.

  read more …

Posted in R, Toolbox | Tagged , | Leave a comment

When k-means Clustering Fails

Letting the computer automatically find groupings in data is incredibly powerful and is at the heart of “data mining” and “machine learning”. One of the most widely used methods for clustering data is k-means clustering. Unfortunately, k-means clustering can fail spectacularly as in the example below.   read more …

Posted in R | Tagged , , | 1 Comment

Visualizing Bikeshare Data

Seattle’s Pronto bikeshare system recently announced a Data Challenge for data visualization using their first year of trip data. As avid cyclists and data analysis junkies, we of course took the bait. Below is a brief description of our Pronto Databrowser submission.   read more …

Posted in Data Visualization, R | Tagged , , | 2 Comments

Function Argument Lists and missing()

Sometimes it is useful to write a wrapper function for an existing function. In this short example we demonstrate how to grab the list of arguments passed to a function and use it to call another function, taking care of optional arguments with or without default values.   read more …

Posted in R | Leave a comment

MazamaSpatialUtils — Ebola Map Example

The MazamaSpatialUtils package on CRAN has just been updated with additional shape file conversion scripts and location buffering so that points located just outside of polygons (i.e. coastal sites) can still be associated with the nearest neighboring polygon.  This package can now be used as an off-line equivalent for the functionality available at the geonames web service.

In this post I will demonstrate how to use the package to duplicate the kind of high quality maps one sees elsewhere on the internet.

  read more …

Posted in Data Visualization, R | Tagged , , , , | Leave a comment