Introduction to R: Installation, Using R as a Calculator, Operators

October 15, 2012
By

Intro to R Hello, and welcome to my blog. The goal of this is to introduce people to R in a way that is easy to grasp. It's command line interface can be pretty intimidating, so hopefully this can help ease you into it. Chances are, if you're reading this, you're a close friend of mine (I don't have much...

Read more »

ggplot2 primer in 10 minutes

October 15, 2012
By
ggplot2 primer in 10 minutes

Here’s a nice presentation from Christophe Ladroue which really does give an insight into the R package ggplot2 if you’ve never used it before. Each line of code can be clicked on to reveal the corresponding graph!

Read more »

Presentation: Animated graphs in R

October 15, 2012
By
Presentation: Animated graphs in R

As animatedgraphs.co.uk takes shape, and following the great reception it got at the Stata Users Group in London in September, I’m pleased to announce I will be giving the same presentation – for R this time – at the LondonR … Continue reading →

Read more »

Estimation of the number PI – A Monte Carlo simulation

October 15, 2012
By
Estimation of the number PI – A Monte Carlo simulation

How to estimate PI when we only have R and the formula for the surface of a circle (Surface = PI * r * r)?The estimation of this number has been one of the greatest challenge in the history of mathematics. PI is the ratio between a circle's circumferen...

Read more »

The Shape of Floating Point Random Numbers

October 15, 2012
By
The Shape of Floating Point Random Numbers

Over the weekend, Viral Shah updated Julia’s implementation of randn() to give a 20% speed boost. Because we all wanted to test that this speed-up had not come at the expense of the validity of Julia’s RNG system, I spent some time this

Read more »

Example 10.6: Should Poisson regression ever be used? Negative binomial vs. Poisson regression

October 15, 2012
By
Example 10.6: Should Poisson regression ever be used? Negative binomial vs. Poisson regression

In practice, we often find that count data is not well modeled by Poisson regression, though Poisson models are often presented as the natural approach for such data. In contrast, the negative binomial regression model is much more flexible and is therefore likely to fit better, if the data are not Poisson. In example 8.30 we...

Read more »

Gale-Shapley Deferred Acceptance in R

October 15, 2012
By
Gale-Shapley Deferred Acceptance in R

In honor of today’s announcement of the Nobel Prize for Roth and Shapley, I found an illustration of the deferred acceptance algorithm from 1962 in R. Credit for the code goes to the blogger at Letters from London, and I’ve included a Gi...

Read more »

What a nice looking scatterplot!

October 15, 2012
By
What a nice looking scatterplot!

This week, we look at plotting data using scatterplots. I'll definitely have a post on other ways of plotting data, like boxplots or histograms.Our data from last week remains the same:First, a quick way to look at all of your continuous variables at once is just to do a plot command of your data....

Read more »

Text Mining

October 15, 2012
By
Text Mining

When it comes down to it R does a really good job handling structured data like matrices and data frames. However, its ability to work with unstructured data is still a work in progress. It can and it does handle text mining but the documentation is incomplete and the capabilities still don’t compare to other

Read more »

Compressed Sensing with R

October 15, 2012
By
Compressed Sensing with R

Compressed sensing (CS) is pretty much appealing all current signal processing research community. At the same time, popularity of R language gaining a strong foot in the research and industry. Even though historically MATLAB is a de-facto standard in ...

Read more »

Review of “R For Dummies”

October 15, 2012
By
Review of “R For Dummies”

The authors are Andrie de Vries and Joris Meys. Executive summary Pretty much all I’d hoped for — and I had high hopes. Significance The “Dummies” series is popular for introducing specific topics in an inviting way. R For Dummies is a worthy addition to the pack. There is a competitor by the name of … Continue reading...

Read more »

Annotations for “R For Dummies”

October 15, 2012
By
Annotations for “R For Dummies”

Here are detailed comments on the book.  Elsewhere there is a review of the book. How to read R For Dummies In order to learn R you need to do something with it.  After you have read a little of the book, find something to do.  Mix reading and doing your project. You cannot win … Continue reading...

Read more »

Banking to n degrees

October 15, 2012
By
Banking to n degrees

As often happens, I have learned of a technique just as it is being called into question. In this case, the technique is changing the aspect ratio of a line plot such that the typical slope of each segment is 45° (see), a rule of thumb which has bee...

Read more »

Using consistent R and LaTeX fonts in Org (or knitr, or Sweave)

October 15, 2012
By
Using consistent R and LaTeX fonts in Org (or knitr, or Sweave)

I love good typography, even more so as Microsoft Word and PowerPoint have debased our standards. When I see a really fine piece of technical typesetting, it’s almost always done using TeX and friends. Beautiful LaTeX documents are easy to … Continue reading →

Read more »

How do I re-arrange…?: Ordering a plot.

October 15, 2012
By
How do I re-arrange…?: Ordering a plot.

One of the most widely seen FAQ coming across list serves and R help sites is the question: “How do I re-arrange/re-order (plotting geom/aesthetic such as bar/labels) in a (insert plot type here) using(insert graphics system here) in R?” . … Continue reading →

Read more »

Fixing non positive definite correlation matrices using R

Problem When a correlation or covariance matrix is not positive definite (i.e., in instances when some or all eigenvalues are negative), a cholesky decomposition cannot be performed. Sometimes, these eigenvalues are very small negative numbers and occur due to rounding or due to noise in the data. In simulation studies a known/given correlation has to be imposed on an input...

Read more »

2012-7 A Structured Approach for Generating SVG

October 14, 2012
By

The gridSVG package exports grid images to an SVG format for viewing on the web. This article describes a new development in the way that gridSVG produces the SVG output. The result is greater flexibility in how the SVG output … Continue reading →

Read more »

New version of httr: 0.2

October 14, 2012
By
New version of httr: 0.2

We’re happy to announce a new version of httr, a package designed to make it easy to work with web APIs. Httr is a wrapper around RCurl, and provides: functions for the most important http verbs: GET, HEAD, PATCH, PUT, DELETE and POST. automatic cookie handing across requests, connection sharing, and standard SSL config. a

Read more »

Rcpp 0.9.15

October 14, 2012
By

Rcpp release 0.9.15 is now on CRAN and being uploaded to Debian. Martin Morgan provided a clever fix for a header search needed between clang++ (especially on OS X) and g++ (which still provided libstdc++ and headers for clang++). This should hopefu...

Read more »

A very quick introduction to ggplot2

October 14, 2012
By
A very quick introduction to ggplot2

I gave a very brief 10mn introduction to ggplot2 at the Birmingham R user group meeting on Monday. The aim was to give a headstart to R users who’ve heard of ggplot2 but never got around to trying it. I … Continue reading →

Read more »

Putting a football model into JAGS

October 14, 2012
By
Putting a football model into JAGS

In this post the football model is programmed into JAGS. There are all the reasons to do so. Jags 3.3 is recently released, I was stimulated by Gianluca's post . Obviously I could copy the model in his paper, but that would be too easy a...

Read more »

Dark matter benchmarks: All over the map

October 14, 2012
By
Dark matter benchmarks: All over the map

The three benchmark algorithms for predicting the location of dark matter halos are, for the most part, all over the map. Most of the test skies look something like this: There are, however, some skies with rather strong halo signals that get a decent amount of agreement: The Lenstool MLE algorithm is the current state

Read more »

Vice Presidential Debates with qdap-beta

October 13, 2012
By
Vice Presidential Debates with qdap-beta

After the presidential debates I used the beta version of qdap to provide some initial surface level analysis (LINK to Presidential Debates with qdap-beta). In the comments of that post, annon (a commenter) provided a link to an analysis/visualization that … Continue reading →

Read more »

Observing Dark Worlds – Visualizing dark matter’s distorting effect on galaxies

October 13, 2012
By
Observing Dark Worlds – Visualizing dark matter’s distorting effect on galaxies

Some people like to do crossword puzzles. I like to do machine learning puzzles. Lucky for me, a new contest was just posted yesterday on Kaggle. So naturally, my lazy Saturday was spent getting elbow deep into the data. The training set consists of a series of ‘skies’, each containing a bunch of galaxies. Normally,

Read more »

The unicorn problem

October 13, 2012
By
The unicorn problem

Let’s say your goal is to observe all known species in a particular biological category. Once a week you go out and collect specimens to identify, or maybe you just bring your binoculars to do some spotting. How long will it take you to cross off every species on your list? I’ve been wondering this

Read more »

The movement of a drunk guy – Random Walk and exponential regression

October 13, 2012
By
The movement of a drunk guy – Random Walk and exponential regression

I was in a party last night and a guy was totally drunk. Not just the guy who had a few drinks and speaks a bit too loud, but the one who is not very likely to remember what he has done during his night, but who is rather very likely to suffer from a h...

Read more »

Agreement between code readability ratings given by students

October 13, 2012
By
Agreement between code readability ratings given by students

I have previously written about how we know nothing about code readability and questioned how the information content of expressions might be calculated. Buse and Weimer ran a very interesting experiment that asked subjects to rate short code snippets for readability (somebody please rerun this experiment using professional software developers). I’m interested in measuring how

Read more »

Overfitting

October 13, 2012
By
Overfitting

What do you think when you see a model like the one below? Does this strike you as a good model? Or as a bad model? There’s no right or wrong answer to this question, but I’d like to argue that models that are able to match white noise are typically bad things, especially when

Read more »

How to choose the right *apply function

October 13, 2012
By

How to choose the right *apply function: This is an amazing stackoverflow answer to help you decide which of the many *apply functions (apply, lapply, sapply, vapply, mapply, rapply, tapply) is appropriate for the task at hand. I’m planning on doing...

Read more »

Sponsors