151 search results for "iris"

Making R graphics legible in presentation slides

July 30, 2012
By
Making R graphics legible in presentation slides

I only visited a few JSM sessions today, as I’ve been focused on preparing for my own talk tomorrow morning. However, I went to several talks in a row which all had a common problem that made me cringe: graphics … Continue reading →

Read more »

Error metrics for multi-class problems in R: beyond Accuracy and Kappa

July 6, 2012
By
Error metrics for multi-class problems in R: beyond Accuracy and Kappa

The caret package for R provides a variety of error metrics for regression models and 2-class classification models, but only calculates Accuracy and Kappa for multi-class models.  Therefore, I wrote the following function to allow caret:::train t...

Read more »

Simple distribution plot in R

July 2, 2012
By
Simple distribution plot in R

Plot the distribution of a sample as bars and add a histogram line for visualizing the sample characteristics. No related posts.

Read more »

Figuring an exchange rate for sports scores

June 26, 2012
By

While the US's Major League Soccer is using advanced analytics to analyze ball movement and improve team composition, they might want to think about a smaller, but possibly more impactful, goal for analytics. Like, how to explain to an American audience what a 1-2 game means to a basketball or baseball fan not familiar with scoring in the beautiful...

Read more »

How to Convert Rugby into Football/Soccer Scores

June 26, 2012
By
How to Convert Rugby into Football/Soccer Scores

Following the Irish rugby team’s humiliating 60-0 defeat to New Zealand, an interesting question was posed on Twitter: what does a 60-0 result convert to in football/soccer? Intrigued, I decided to gather some data from both the English premier league (this season, more data collected and future blog posts to come!) and the equivalent English

Read more »

Time-Series Policy Evaluation in R

May 21, 2012
By
Time-Series Policy Evaluation in R

Quantifying the success of government policies is clearly important. Randomized control trials, like those conducted by drug companies, are often described as the ‘gold-standard’ for policy evaluation. Under these, a policy is implemented in/to one area/group (treatment), but not in/to another (control). The difference in outcomes between the two areas or groups represents the effectiveness

Read more »

Emulating local static variables in R

May 17, 2012
By
Emulating local static variables in R

Recently I was writing a code allowing to plot multiple ggplot2 plots on one page. I wanted to replicate standard behavior of  plot  function that plots graphs in sequence according to  mfrow/ mfcol option in par...

Read more »

Functions ddply and melt make plotting summary stats in R more tolerable

May 15, 2012
By
Functions ddply and melt make plotting summary stats in R more tolerable

The main reason why I have usually chosen to use excel to make my plots at work is because I had difficulty feeding the summary stats in R into a plotting function.  One thing I learned this week is how … Continue reading →

Read more »

Plotting data and distribution simultaneously (with ggplot2)

May 14, 2012
By
Plotting data and distribution simultaneously (with ggplot2)

Ever wanted to see at a glance the distribution of your data across different axes? It happens often to me, and R allows to build a nice plot composition - This is my latest concoction. I used ggplot2 here, but equivalent graphics can be made...

Read more »

Porting cdplot to ggplot2

May 11, 2012
By
Porting cdplot to ggplot2

Last week I published a post on plotting tables in ggplot2. So the next natural step is to port cdplot to allow simple visualization of categorical variables against a numerical predictor.First part of the story covers binary variables. In th...

Read more »