R Environments for Gibbs Sampler State

August 10, 2010
By
R Environments for Gibbs Sampler State

I recently decided to revisit some R code that implements a Gibbs sampler in an attempt to decrease the iteration time. My strategy was to implement the sampler state as an R environment rather than a list. The rationale was that passing an environment to and from functions would reduce the amount of duplication (memory

Read more »

Conditioning Systems on Regime Variables

August 10, 2010
By
Conditioning Systems on Regime Variables

Here is a brief and simple example of switching systems based upon regime type (sometimes called gating). I've brought up the idea of conditioning systems based upon regimes many times in past posts. Some texts call this filtering, although I prefer t...

Read more »

A Twitter feed for R links

August 10, 2010
By

India-based data scientist Harsh Singhal has compiled "State of the R": a list of more than 50 links to R-related websites, which has generated much discussion on the R Project group on LinkedIn. Now, even if you're not on LinkedIn, you can find the list at the new Links4R Twitter profile, and get updates about new links by following...

Read more »

Just for Fun: Using R to Create Targets

August 10, 2010
By

OK, not really science or soil-related, but a fun 5 minute use of R to make something you can use to improve your hand-eye coordination. read more

Read more »

Homogeneity analysis of hierarchical classifications

August 10, 2010
By
Homogeneity analysis of hierarchical classifications

I've spent more years than I care to remember analysing vegetation survey data (typically species abundances in plots) using a variety of software including my own algorithms coded in FORTRAN and C++. A recent query on the r-help list, about how to determine the number of groups to define in a hierarchical classification produced with the hclust function, prompted...

Read more »

Homogeneity analysis of hierarchical classifications

August 10, 2010
By
Homogeneity analysis of hierarchical classifications

I've spent more years than I care to remember analysing vegetation survey data (typically species abundances in plots) using a variety of software including my own algorithms coded in FORTRAN and C++. A recent query on the r-help list, about how to det...

Read more »

RQuantLib 0.3.4

August 9, 2010
By

A fresh release of RQuantLib is now on CRAN and in Debian. RQuantLib combines (some of) the quantitative analytics of QuantLib with the R statistical computing environment and language. This follows the 0.3.3 release from last week and has again a num...

Read more »

RQuantLib 0.3.4

August 9, 2010
By

A fresh release of RQuantLib is now on CRAN and in Debian. RQuantLib combines (some of) the quantitative analytics of QuantLib with the R statistical computing environment and language. This follows the 0.3.3 release from last week and has again ...

Read more »

An HSV colour wheel in R

August 9, 2010
By
An HSV colour wheel in R

If you’ve read any of my previous posts, you’ll notice that they’re rather scanty on colour. There’s a reason for this. Mainly, that to get a good colour output takes some time. I recently read a commentary in Nature methods (sorry if you don’t have access to it, but this looks like it may be

Read more »

R unfolds the history of the Afghanistan war

August 9, 2010
By
R unfolds the history of the Afghanistan war

Drew Conway continues his analysis of the Wikileaks data. Having concluded that the data appear legitimate (except perhaps in one region, based on a Benford's Law analysis of the numbers in the documents), Drew follows up with a spatio-temporal analysis of activity within Afghanistan, based on the datelines of the documents themselves (click to enlarge): Each panel represents a...

Read more »

Quickly Find the Class of data.frame vectors in R

August 9, 2010
By

Aviad Klein over at My ContRibution wrote a convenient R function to list the classes of all the vectors that make up a data.frame. You would think apply(kyphosis,2,class) would do the job but it doesn't - it calls every vector a character class. Aviad wrote an elegant little function that does the job perfectly without having to load any...

Read more »

Useful functions for data frames

August 9, 2010
By

The R software system is primarily command line based so when there are large sets of data it is not easy to browse the data frames. There are various useful functions for working with data frames. For example, after loading data from a text file we might want to view the first few lines of a

Read more »

GitHub Stats on Programming Languages

August 9, 2010
By
GitHub Stats on Programming Languages

GitHub has become a popular site for Open Source Developers to stash code and collaborate on projects.  The following are some stats and analysis related to programming languages in use based upon the number of users and repositories.  T...

Read more »

R has the best models

August 9, 2010
By
R has the best models

We had a great time at the JSM conference, and I really enjoyed meeting with all the useRs at the Revolution mixer on Wednesday evening (where this photo was taken). Hope everyone had a great time -- thanks for coming!

Read more »

New R Package ‘aqp’: Algorithms for Quantitative Pedology [updates]

August 9, 2010
By
New R Package ‘aqp’: Algorithms for Quantitative Pedology [updates]

  Soils are routinely sampled and characterized according to genetic horizons (layers), resulting in data that are associated with principal dimensions: location (x,y), depth (z), and property space (p). The high dimensionality and grouped nature...

Read more »

Installing RApache on Mac OS X Snow Leopard

August 9, 2010
By

Hi Folks,for a research project I needed to install RApache on my Mac OS X 10.6.4 (Snow Leopard) machine.It did take some time, a lot of beeping in the video documentary, a lot of recompiles…Here is the way to do it:1. Install Gnu Fortran on your MacYou need to install Gnu Fortran on your Mac, because you have...

Read more »

Installing RApache on Mac OS X Snow Leopard

August 9, 2010
By

Hi Folks,for a research project I needed to install RApache on my Mac OS X 10.6.4 (Snow Leopard) machine.It did take some time, a lot of beeping in the video documentary, a lot of recompiles…Here is the way to do it:1. Install Gnu Fortran on your MacYou need to install Gnu Fortran on your Mac, because you have...

Read more »

Handling Large CSV Files in R

A follow-up of my previous post Excellent Free CSV Splitter. I asked a question at LinkedIn about how to handle large CSV files in R / Matlab. Specifically, Quotationsuppose I have a large CSV file with over 30 million number of rows, both Matlab / R lacks memory when importing the data. Could you...

Read more »

Iris Data Set Visualization Web App in < 100 LOC

August 7, 2010
By
Iris Data Set Visualization Web App in < 100 LOC

The iris data set pops up pretty regularly in statistical literature.  It consists of 50 records from three species of Iris flowers (Iris setosa, Iris virginica and Iris versicolor).   I came across it recently while reading

Read more »

Wikileaks Attack Data by Year and Type Projected on Afghanistan Regional Map

August 7, 2010
By
Wikileaks Attack Data by Year and Type Projected on Afghanistan Regional Map

Below is a visualization of the Wikileaks data produced in collaboration with Michael Dewar. This plot shows attacks in the data set by year and type, projected onto a map of Afghanistan with district boundaries. This visualization is certainly not perfect, i.e., some colors are difficult to discern, but it does provide added insight to the

Read more »

Creating a Presentation with LaTeX Beamer – Including Images from Graphics Files

August 7, 2010
By
Creating a Presentation with LaTeX Beamer – Including Images from Graphics Files

It will often be more efficient to generate graphics in an external software package and then include these files in a LaTeX beamer presentation. The standard LaTeX approach to including graphics can be utilised to perform this task. Fast Tube by Casper The graphicx is useful for including graphics files in a presentation and this package has

Read more »

Julian Besag 1945-2010

August 7, 2010
By
Julian Besag 1945-2010

I have just learned that Julian Besag passed away last morning in Bristol after being admitted to the hospital two weeks ago. He was a leading figure of our field, a fiercely independent thinker, a brilliant statistician, and undoubtedly the clearest pretendent to having fathered MCMC. His influence on the field of spatial statistics will

Read more »

RInside release 0.2.3

August 6, 2010
By

A new 0.2.3 release of RInside is now on CRAN. RInside is a set of convenience classes which facilitate embedding of R inside of C++ applications and programs. RInside works particularly well with Rcpp and now depends on it. This is the first release ...

Read more »

RInside release 0.2.3

August 6, 2010
By

A new 0.2.3 release of RInside is now on CRAN. RInside is a set of convenience classes which facilitate embedding of R inside of C++ applications and programs. RInside works particularly well with Rcpp and now depends on it. This is the first re...

Read more »

Because it’s Friday: Foxes on a Trampoline

August 6, 2010
By

They're foxes. They're on a trampoline. And they're jumping. I don't think there's much more for me to add:

Read more »

Finding out (fast) the classes of data.frame vectors

August 6, 2010
By
Finding out (fast) the classes of data.frame vectors

Sometimes it’s useful to write down the various classes of vectors inside your data.frame objects for documentation and other people to use it. I’ve searched for a quick way to find out all the classes of vectors inside a data.frame. Since I’ve found no reference for such a function/process I made one up. I’d like [&hellip

Read more »

How to animate Google Earth with R

August 6, 2010
By
How to animate Google Earth with R

We've looked before at how you can annotate geographical maps using R, but what if you want to overlay data onto a globe of the Earth, using Google Earth? The RKML package for R (from the OmegaHat project) allows you to do just that, by providing a high-level interface from R to generate KML files, which in turn are...

Read more »

Twenty rules for good graphics

August 6, 2010
By
Twenty rules for good graphics

One of the things I repeatedly include in referee reports, and in my responses to authors who have submitted papers to the International Journal of Forecasting, are comments designed to include the quality of the graphics. Recently someone asked on stats.stackexchange.com about best practices for producing plots. So I thought it might be helpful to

Read more »

Combinadics in R

August 5, 2010
By
Combinadics in R

A question on stats.stackexchange.com reminded me of some code I wrote earlier this summer. The code provides a correspondence between the natural numbers 1 to (N choose K) and all the unique K sized combinations one could draw from N items. This relationship is know as the combinadic of an integer (and my code is pased on...

Read more »