Colours in R

September 19th, 2011

There is a handy webpage which provides a chart of colours available in R. The chart is also available in pdf from the webpage.

Getting rid of white space at the beginning and end of a string

July 28th, 2011

There are situations where we are working with character strings extracted from various sources and it can be annoying when there is white space at the beginning and/or end of the strings. This whitespace can cause problems when attemping to sort, subset or various other common operations. Read the rest of this entry »

R.NET

July 4th, 2011

The R.NET project provides a mechanism for communicating with R from a .NET application. This appears to be a promising way to create simple interfaces to some of the functionality of R. Read the rest of this entry »

Generalized Linear Models – Poisson Regression

June 26th, 2011

The Generalized Linear Model (GLM) allows us to model responses with distributions other than the Normal distribution, which is one of the assumptions underlying linear regression as used in many cases. When data is counts of events (or items) then a discrete distribution is more appropriate is usually more appropriate than approximating with a continuous distribution, especially as our counts should be bounded below at zero. Negative counts do not make sense. Read the rest of this entry »

Handling Errors Gracefully

May 27th, 2011

In R functions sometimes produces warnings or errors. In the case of errors execution of a function or a series of commands can get halted when an error occurs, which can in some cases be frustrating especially if we want to continue our calculations. Read the rest of this entry »

RStudio

April 29th, 2011

As has been discussed on various blogs the RStudio interface to R has been released. It is definitely worth checking out as it has the potential to improve the user experience for R.

R Matrix Operations

March 27th, 2011

R can be used to perform various matrix calculations. This include functions for creating matrices (matrix), addition (+), multiplication (%*%) and inversion (solve). Read the rest of this entry »

R Package Automated Download

March 6th, 2011

There are situations where we might want to run R on a standalone machine so need to download a (potentially) large number of packages to install on this system. Rather than having to through the pain of searching through CRAN to find the packages and all the dependencies and manually download, it would be nice to be able grab all available packages in one go and then set them up as a local repository. Read the rest of this entry »

Programming with R – Processing Football League Data Part II

December 3rd, 2010

Following on from the previous post about creating a football result processing function for data from the football-data.co.uk website we will add code to the function to generate a league table based on the results to date. Read the rest of this entry »

Programming with R – Processing Football League Data Part I

November 23rd, 2010

In this post we will make use of football results data from the football-data.co.uk website to demonstrate creating functions in R to automate a series of standard operations that would be required for results data from various leagues and divisions. Read the rest of this entry »

Statistics Books