Articles by Ralph

Installing R on Ubuntu

February 8, 2014 | Ralph

The R statistical software is provided either as source code or pre-compiled binary files. In the majority of cases the binaries are sufficient but there may be situations where it is necessary to compile the software from source code and this post describes the steps required on an Ubuntu Linux ... [Read more...]

Google Maps and ggmap

December 22, 2013 | Ralph

The ggmap package can be used to access maps from the Google Maps API and there are a number of examples on various statistics related blogs. These include here, here and here. The ggmap package has a function get_map that can download maps from various sources including Google Maps. ... [Read more...]

Word Clouds using Text Mining

December 19, 2013 | Ralph

There was an interesting post on a blog which showed how straightforward it is to use the text mining tools (tm) from R along with the wordcloud package to create Word Clouds. Following the example from this page I processed the text of the Golden Asse book (found at Project ... [Read more...]

Seasonal Trend Decomposition in R

January 11, 2013 | Ralph

The Seasonal Trend Decomposition using Loess (STL) is an algorithm that was developed to help to divide up a time series into three components namely: the trend, seasonality and remainder. The methodology was presented by Robert Cleveland, William Cleveland, Jean McRae and Irma Terpenning in the Journal of Official Statistics ... [Read more...]

Split strings based on a character in the string

December 11, 2012 | Ralph

R has various facilities for string manipulation including the strsplit function to divide a string into substrings based on matching to another string. A simple example is shown below __ strsplit("Stuff", "" [3] "a href=\"/path/test.html\" target=\"\" title=\"An Object\" class=\"myObject\"__Stuff" [4] "/a__" [5] "/td__" […] [Read more...]

Theme Elements in ggplot2

May 3, 2012 | Ralph

This website provides a simple summary of the theme elements that can be set within ggplot2. There should be sufficient information here to change the default settings for graphs within the ggplot2 package. [Read more...]

Melt

April 5, 2012 | Ralph

There are many situations where data is presented in a format that is not ready to dive straight to exploratory data analysis or to use a desired statistical method. The reshape2 package for R provides useful functionality to avoid having to hack data around in a spreadsheet prior to import ... [Read more...]

Useful functions for data frames in R

February 17, 2012 | Ralph

This post will consider some useful functions for dealing with data frames during data processing and validation. Consider an artifical data set create using the expand.grid function where there are duplicate rows in the data frame. __ des = expand.grid(A = c(2,2,3,4), B = c(1,3,5,5,7)) __ des A B 1 2 1 2 2 1 [...] [Read more...]

Surfaces in ternary plots

January 31, 2012 | Ralph

In mixture experiments there is a constraint that the variables are the proportions of components that are mixed together with the consequence that these proportions sum to one. When fitting regression models to data from mixture experiments we may be interested in reprenting the fitted model with a surface plot. ... [Read more...]

Tikz absolute positioning

November 20, 2011 | Ralph

When working with a tikz drawing within LaTeX document we might want to locate an object using an absoute position on the page rather than leaving LaTeX to make the decision for us. The use of nodes and the current.page label in conjunction with some other parameters attached to ... [Read more...]

Tikz Nodes

October 17, 2011 | Ralph

Nodes are used in tikz to place content in a picture as part of a LaTeX document. Fast Tube by Casper When creating a tikz picture the origin is assumed to be at (0,0) and objects are placed with positioning relative to the origin on the picture. If we wanted to ... [Read more...]

Tikz Introduction

September 27, 2011 | Ralph

The pgf drawing package for LaTeX provides facilities for drawing simple of complicated pictures within a LaTeX document. There are many options available within the package and in this post we consider some of the basics to get up and running. Fast Tube by Casper As with all LaTeX documents ... [Read more...]

Cricket All Round Performances

September 19, 2011 | Ralph

In cricket a player who can perform well with both the bat and bowl is a great asset for any team and across the history of international cricket there have been a number of cricketers that hall into this bracket. It is difficult to specify a set of criteria to ... [Read more...]

Scatter plots with images

September 4, 2011 | Ralph

Edward Tufte has written extensively on the presentation of data covering good and bad practice. He has made a number of suggestions for adaptations of regularly used graph types to assist with the interpretation and understanding of data. One idea for enhancing scatter plots covered in Tufte’s book Beautiful ... [Read more...]

R.NET

July 4, 2011 | Ralph

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. Some examples of using R.NET can be found here and here. [Read more...]

Generalized Linear Models – Poisson Regression

June 26, 2011 | Ralph

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 ... [Read more...]

Handling Errors Gracefully

May 27, 2011 | Ralph

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. There are various functions available in ... [Read more...]

Fractional Factorial Designs using FrF2

May 18, 2011 | Ralph

The FrF2 package for R can be used to create regular and non-regular Fractional Factorial 2-level designs. It is reasonably straightforward to use. First step is to install the package then make it available for use in the current session: require(FrF2) A basic call to the main functino FrF2 ... [Read more...]
1 2 3 5

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)