Blog Archives

Pearson’s r: Not a good measure of electoral persistence

December 30, 2012
By
Pearson’s r: Not a good measure of electoral persistence

Pearson’s product-moment correlation, \(r\), is an incredibly useful tool for getting some idea about how two variables are (linearly) related. But there are times when using Pearson’s \(r\) is not appropriate and, even if linearity and all other assumptions hold, … Continue reading →

Read more »

R Tip: Avoid using T and F as synonyms for TRUE and FALSE

December 11, 2012
By

By default when you start R, T and F are defined as TRUE and FALSE. When I review other people’s code, I often see functions defined with arguments set to these values by default. This is a very bad idea. … Continue reading →

Read more »

Closures in R: A useful abstraction

December 2, 2012
By

People who have been using R for any length of time have probably become accustomed to passing functions as arguments to other functions. From my experience, however, people are much less likely to return functions from their own custom code. … Continue reading →

Read more »

Filtering a list with the Filter higher-order function

January 26, 2012
By

Last week markbulling over at Drunks & Lampposts posted a method of using sapply to filter a list by a predicate. Today the @RLangTip tip of the day was to use sapply similarly. This made makes me wonder if R‘s … Continue reading →

Read more »

Announcing boolean3 (beta)

January 24, 2012
By

After entirely too long, I am happy to announce the beta release of boolean3, an R package for modeling causal complexity. The package can be downloaded at the following links: Unix/Linux: boolean3_3.0.20.tar.gz Windows: boolean3_3.0.20.zip (Please let me know if you have any … Continue reading →

Read more »

Retrieving RSS Feeds Using Google Reader

January 13, 2012
By
Retrieving RSS Feeds Using Google Reader

I have been working on a new package makeR to help manage Sweave projects where you wish to create multiple versions of documents that are based on a single source. For example, I create lots of monthly and quarterly reports using Sweave and the only differences between versions are a few variables. I have used GNU

Read more »

Visualizing Likert Items

November 11, 2011
By
Visualizing Likert Items

I have become quite a big fan of graphics that combine the features of traditional figures (e.g. bar charts, histograms, etc.) with tables. That is, the combination of numerical results with a visual representation has been quite useful for exploring descriptive statistics. I have wrapped two of my favorites (build around ggplot2) and included them as part

Read more »

Managing a Local R Repository

November 10, 2011
By

I will be teaching a workshop on R and LaTeX at NEAIR in just under a month. One of the issues I will encounter is a lack of Internet access. I also work with restricted data from NCES which requires the computer to be secured including no network access. As such, I need to manage software from removable

Read more »

Three free books for better programming in R (and any other language)

September 19, 2011
By

Like many users and producers of R packages, I have never had any formal training in computer science. I’ve come to to the conclusion that this is a serious omission in a professional researcher’s training. Computer scientists and professional hackers … Continue reading →

Read more »

The performance cost of a for-loop, and some alternatives

August 21, 2011
By

I’ve recently been spending a lot of time running various simulations in R. Because I often use snow to perform simulations across several computers/cores, results typically come back in the form of a list object. Summarizing the results from a list … Continue reading →

Read more »