Some Rcpp benchmarks

January 22, 2012
By

I ran the Fibonacci number example from the Rcpp package on a number of computers and operating systems. Here are the results:A. On my main computer (Core 2 Extreme 3.06GHz, 8 GB memory) running Ubuntu 10.04 (g++ 4.4.3):        test...

Read more »

Simulating average height of a random binary search tree

January 22, 2012
By
Simulating average height of a random binary search tree

Recently on Stack Overflow I have found a discussion on Average height of a binary search tree. The problem has been solved analytically, see for example Reed (2003). However, I was intrigued by one of the answers that presented a simulation ...

Read more »

Cluster your Facebook friends

January 22, 2012
By
Cluster your Facebook friends

Last week, I came across two interesting posts by Romain François and Petr Simecek: Crawling Facebook with R, in which Romain explains how to connect to the Facebook Graph API Mining Facebook Data: Most “Liked” Status and Friendship Network, in which Petr use Romain’s function to visualize your friend’s network. As coincidence would have it, I also came across an...

Read more »

Time Series Intervention Analysis wih R and SAS

January 21, 2012
By
Time Series Intervention Analysis wih R and SAS

In a previous post, I worked through the theory behind intervention analysis. In his time series course, University of Georgia political science professor Jamie Monogan demonstrates how to implement intervention analysis in R.  The following examp...

Read more »

Lessons learned from a recent R package submission

January 21, 2012
By
Lessons learned from a recent R package submission

R has zillions of packages, and people are submitting new ones each day. The volunteers who keep R going are doing an incredibly useful service to the profession, and they’re busy. A colleague sends in some suugestions based on a recent experience with a package update: 1. Always use the R dev version to write The post Lessons...

Read more »

Ten reasons to love the cloud

January 21, 2012
By

Ten reasons to love the cloud: The names on Heroku. empty-moon-9726. Suddenly the cloud seems prosaic when you can have the moon. Being reunited with putty. It’s like catching up with an old friend. At first the conversation is a little stilted, but then you soon remember just how well you got on and what brought you together in the first...

Read more »

Initial thanks

January 21, 2012
By

Starting this blog with initial thanks to Josh Suereth from whom I cloned the template of this blog, Tom Preston-Werner who made Jekyll (a static site generator for this blog), Scott Chamberlain who made me aware of it.

Read more »

A Quick View Over a MASHe Google Spreadsheet Twitter Archive of UKGC12 Tweets

January 20, 2012
By
A Quick View Over a MASHe Google Spreadsheet Twitter Archive of UKGC12 Tweets

Following on from A Tool Chain for Plotting Twitter Archive Retweet Graphs – Py, R, Gephi, here’s a quick view summary view over #UKGC12 tweets saved in Google Spreadsheet archive as developed by Martin Hawksey, generated from an R script (R code available here; #ukgc12 tweet archive here)… (I did mean to tidy these up,

Read more »

Separation of degrees

January 20, 2012
By
Separation of degrees

Scientific American has a short article on trends in undergraduate degrees over the past 20 years, illustrated with a great infographic by Nathan Yau. As a big fan of STEM (science, tech, engineering and math) education, I was pleased to … Continue reading →

Read more »

R Regression Diagnostics Part 1

January 20, 2012
By
R Regression Diagnostics Part 1

Linear regression can be a fast and powerful tool to model complex phenomena. However, it makes several assumptions about your data, and quickly breaks down when these assumptions, such as the assumption that a linear relationship exists between the predictors and the dependent variable, break down. In this post, I will introduce some diagnostics that you can...

Read more »

Time Series Matching with Dynamic Time Warping

January 20, 2012
By
Time Series Matching with Dynamic Time Warping

THIS IS NOT INVESTMENT ADVICE. The information is provided for informational purposes only. In the Time Series Matching post, I used one to one mapping to the compute distance between the query(current pattern) and reference(historical time series). Following chart visualizes this concept. The distance is the sum of vertical lines. An alternative way to map

Read more »

MAT8886 Extremes and sums (of i.i.d. random variables)

January 20, 2012
By
MAT8886 Extremes and sums (of i.i.d. random variables)

Yesterday, we have discussed briefly sums and maximas of i.i.d. random variables using the concept of subexponential distributions. Today, we will introduce the concept of regular variation: a positive function is said to be regularly varying (at i...

Read more »

Object Oriented Programming in R

January 20, 2012
By

As someone who was a Java programmer for many years learning R’s object oriented programming framework has been frustrating to say the least. I like the simplicity of S3 but find it limiting when you wish to write methods that change the underlying data elements. That is, printing, summarizing, and plotting work great because they

Read more »

Hadley Wickham goes behind the scenes on ggplot2

January 20, 2012
By
Hadley Wickham goes behind the scenes on ggplot2

Hadley Wickham, creator of the ggplot2 packages for R (as well as several others) will present a webinar on February 8 going behind the scenes of the popular graphics package. If you've never used ggplot2 before, this will be a great way to learn about the kinds of charts you can create with it; and if you're a regular...

Read more »

R Regression Diagnostics Part 1

January 20, 2012
By
R Regression Diagnostics Part 1

Linear regression can be a fast and powerful tool to model complex phenomena. However, it makes several assumptions about your data, and quickly breaks down when these assumptions, such as the assumption that a linear relationship exists between the predictors and the dependent variable, break down. In this post, I will introduce some diagnostics that you can perform to...

Read more »

Object Oriented Programming in R

January 20, 2012
By

As someone who was a Java programmer for many years learning R’s object oriented programming framework has been frustrating to say the least. I like the simplicity of S3 but find it limiting when you wish to write methods that change the underlyi...

Read more »

Object Oriented Programming in R

January 20, 2012
By

As someone who was a Java programmer for many years learning R’s object oriented programming framework has been frustrating to say the least. I like the simplicity of S3 but find it limiting when you wish to write methods that change the underlyi...

Read more »

Power and Sample Size for Repeated Measures ANOVA with R

January 20, 2012
By
Power and Sample Size for Repeated Measures ANOVA with R

Background One of my colleagues is an academic physical therapist (PT), and he's working on a paper to his colleagues related to power, sample size, and navigating the thicket of trouble that surrounds those two things. We recently got together to walk through some of the issues, and I thought I would share some of the wildlife we observed...

Read more »

Project Euler in R: Problem 24

January 19, 2012
By

I had previously posted solutions in R to Project Euler problem 23 and problem 22.  This is the next problem from Project Euler. The statement of problem 24 is as follows.A permutation is an ordered arrangement of objects....

Read more »

Connect to the Facebook API with R for Windows Users

January 19, 2012
By

Recently there have been some great posts that highlight how easy it is to hook into the Facebook Graph API using R. Crawling Facebook with R started the discussion and Apply R highlighted how easy it was to plot our network. In order to replicate the examples on Windows, most likely you will need to

Read more »

Knitr is Awesome!

January 19, 2012
By

I love TikZ in LaTeX and I use it exclusively when writing figures for my papers. I also use the tikzDevice package to convert all figures I create in R to TikZ code, so the font used in the text and figures is the same (and having your R figures in Ti...

Read more »

Scoping functions in R

January 19, 2012
By

I want to test embedding source code in the blog by using the handy Gist tool provided by GitHub. These two R functions are a good opportunity to test out embedding a Gist on the website. These functions allow for threshold testing within a vector in R...

Read more »

Is your phylogeny informative?

January 19, 2012
By
Is your phylogeny informative?

Yesterday my paper   appeared in early view in Evolution (author’s preprint),1 so I’d like to take this chance to share the back-story and highlight my own view on some of our findings, and the associated package on CRAN.2 I didn’t set out to write this paper.  I set out to write a very different

Read more »

Winning from losing

January 19, 2012
By
Winning from losing

By following twitter’s #rstats hashtag (rss feed), I recently came across a very interesting R-related blog: datanalytics.com. The first post I read from it was about setting up an on-line reading group to go through the excellent “The Elements of … Continue reading →

Read more »

Analyzing Federal Government Bailout Recipients in R

January 19, 2012
By
Analyzing Federal Government Bailout Recipients in R

I was searching for open data recently, and stumbled on Socrata. Socrata has a lot of interesting data sets, and while I was browsing around, I found a data set on federal bailout recipients. Here is the data set. However, data sets on Socrata are not always the most recent versions, so I followed a...

Read more »

An Intro to Ensemble Learning in R

January 19, 2012
By

Introduction This post incorporates parts of yesterday's post about bagging. If you are unfamiliar with bagging, I suggest that you read it before continuing with this article. I would like to give a basic overview of ensemble learning. Ensemble learning involves combining multiple predictions derived by different techniques in order to create a stronger overall prediction....

Read more »

Visualize your Facebook friends network with R

January 19, 2012
By
Visualize your Facebook friends network with R

A few days ago, Romain François explained how to interface with the Facebook Graph API explorer with R. This was a low-level interface, giving the R programmer the ability to the raw data that Facebook can provide about your connections. Now, just four days later, the first application in R (that I know of) based on the Facebook Graph...

Read more »

R: Subsetting a list based on a condition

January 19, 2012
By
R: Subsetting a list based on a condition

Quite a handy couple of lines of code to subset a list in R to just those elements which meet a certain condition. Here’s an example to return only those elements of a list which are a certain class. Thanks to this StackOverflow answer.

Read more »

Analyzing Federal Bailout Recipients in R

January 19, 2012
By
Analyzing Federal Bailout Recipients in R

I was searching for open data recently, and stumbled on Socrata. Socrata has a lot of interesting data sets, and while I was browsing around, I found a data set on federal bailout recipients. Here is the data set. However, data sets on Socrata are not always the most recent versions, so I followed a link to...

Read more »