Blog Archives

Scales and transformations in ggplot2 0.9.0

March 14, 2012
By
Scales and transformations in ggplot2 0.9.0

Some R code designed for ggplot2 0.8.9 is not compatible with ggplot2 0.9.0, and today the ggplot2 web site has outdated documentation which gives this broken example: Dennis Murphy points to the ggplot2 0.9.0 transition guide from where I derived … Continue reading →

Read more »

doSMP removed from CRAN

February 17, 2012
By
doSMP removed from CRAN

If you do parallel processing in R on Windows, then you probably have heard of the doSMP package. However, it was recently removed from the CRAN repository with the terse message: Package ‘doSMP’ was removed from the CRAN repository. Revolution … Continue reading →

Read more »

Using neural network for regression

November 17, 2011
By
Using neural network for regression

Artificial neural networks are commonly thought to be used just for classification because of the relationship to logistic regression: neural networks typically use a logistic activation function and output values from 0 to 1 like logistic regression. However, the worth … Continue reading →

Read more »

Train neural network in R, predict in SAS

November 11, 2011
By
Train neural network in R, predict in SAS

This R code fits an artificial neural network in R and generates Base SAS code, so new records can be scored entirely in Base SAS. This is intended to be a simple, elegant, fast solution. You don’t need SAS Enterprise … Continue reading →

Read more »

Confidence interval diagram in R

October 19, 2011
By
Confidence interval diagram in R

This code shows how to easily plot a beautiful confidence interval diagram in R. First, let’s input the raw data. We’ll be making two confidence intervals for two samples of 10. In case you curious, the data represents samples from … Continue reading →

Read more »

Model decision tree in R, score in Base SAS

October 11, 2011
By
Model decision tree in R, score in Base SAS

This code creates a decision tree model in R using party::ctree() and prepares the model for export it from R to Base SAS, so SAS can score new records. SAS Enterprise Miner and PMML are not required, and Base SAS … Continue reading →

Read more »

Paired sample t-test in R

September 28, 2011
By
Paired sample t-test in R

Let’s walk through using R and Student’s t-test to compare paired sample data. The book Statistics: The Exploration & Analysis of Data (6th edition, p505) presents the longitudinal study “Bone mass is recovered from lactation to postweaning in adolescent mothers … Continue reading →

Read more »

Basic line chart with ggplot2

September 27, 2011
By
Basic line chart with ggplot2

ggplot2 is a package for R which easily draws plots that are easier on the eyes than R’s built-in plotting functions, though the grammar is different than what is commonly used in R. This code demonstrates how to prepare a … Continue reading →

Read more »

Two browsers for R help documentation

June 29, 2011
By
Two browsers for R help documentation

The same excellent documentation for R commands is available through two different help browsers: text and HTML, and let’s see how how each looks, works, and how to switch the default. Look and feel Here is how both look for … Continue reading →

Read more »

Benchmarking R, Revolution R, and HyperThreading for data mining

June 27, 2011
By
Benchmarking R, Revolution R, and HyperThreading for data mining

Usually data mining benchmarks measure lift, precision, etc., but wasting analyst time hurts the ROI of any project. I recently upgraded my notebook (where I often use R for data mining) and was faced with two questions: for the fastest … Continue reading →

Read more »