Tag Archives: R Beats Excel

LearnR Toolkit To Help Excel Users Move Up To R

As a former  Excel chart user, I want to help current Excel users make the transition to more advanced charting R with as little difficulty as possible. This post introduces my LearnR Toolkit to help Excel users move up to R in a systematic, step by step fashion.

Introduction

As an Excel chart user, I wanted to produce panel charts like this:

Continue reading

R Lets You Put Chart Inside Chart

In this post I give a quick tip on how to embed one chart within another chart. This can be useful in situations where you want to expand a part of your chart or show distinct ranges of your data set.           Continue reading

Don’t Try This With Excel

In this post I show 4 charts of the same data to demonstrate  what Excel chart users are missing by not having a more powerful charting tool. This post,  building on my previous discussion of using factors for conditional formatting,  shows the potential advantages of plotting summary values and bounding area polygons . These analytical displays are not readily available to even advanced Excel users. Continue reading

Learn R Toolkit Videos

My list of free Learn R Toolkit videos is growing. Here’s the latest list of free videos:

Modules 3-6 of the toolkit includes video training, working R scripts and data files to get you started writing R chart scripts in less than a day. Modules 3 – 6 are available for $19 with my  money back guarantee.

So there’s no reason for you to put off learning R. You now have a risk free way to start using R  for your advanced charts.

Excel’s Missing Factor

In this post I show how R’s factor data type allows users to produce effective charts much more quickly and simply than Excel. Since Excel does not include a “factor” data type, users need to use tricks and workarounds to categorize and display factor type data.

Excel Example Data Set

In  his “VBA to Split Data Range into Multiple Chart Series“  (May, 2008) , Jon Peltier writes:

A common problem is to make a chart from a list like this one. You want separate series for each item in one column (e.g., the cities in the first column), but your list is different every time, and you have to spend an hour assigning data to each series in the chart.

This is a job for VBA. It’s possible to write a simple loop that reads the first column of the range, grouping rows together by item.”

Continue reading

Learn R Toolkit

Learn R Toolkit: I have developed this toolkit to help Excel users quickly learn R so that you can make those advanced charts that you really want to make. I use over 100 PowerPoint slides, 19 videos 40 R scripts, 12 data files and 3 Excel workbooks to lead you up the R learning curve as quickly and comfortably as possible.

As an Excel user, I explain essential R concepts using Excel examples and terminology so that you can learn R fundamentals using your Excel knowledge. The videos demonstrate the R scripts and then you use the same R scripts in a series of assignments. The R scripts are fully commented and organized for reuse so that you can use them as starter scripts for you real world projects. Finally, the PowerPoint slides can be printed out to give you a valuable memory jogger resource. This toolkit will save you many hours learning R.

Visit my web page to get more information about Learn R Toolkit.

R Panel Chart Beats Excel Panel Chart

In this post, I show how to make a 3 variable time series panel chart in R. As an Excel panel chart pioneer, I can tell you that it is very difficult and messy to produce this type of panel chart in Excel.  The example R panel chart uses R’s a step chart format for one plot and R’s vertical line  format for the other 2 plots. Several of R’s dynamic capabilities, not inherently available in Excel, are also used. No helper series are needed and the chart can easily be regenerated each month as new data is available.

Here’s The R Panel Chart

First, let’s take a look at the chart to see what’s so good about R charting.

rss_3_panel Continue reading

R ggplot2 Plot Beats Excel Stacked Column Chart

In this post, I follow up on a previous post to show how Hadley Wickhams’s  R  package,  ggplot2, prepares a multipanel  plot as an alternative to the lattice package. The script was prepared by a skilled reader, Wayne. Continue reading

R Works With Factors

In this post, I show how to create a factor variable  from categorical data and analyze the role of the factor and the decade using  conditional  boxplots  on time series data. Continue reading

R Lattice Plot Beats Excel Stacked Column Chart – Update 3

What’s Wrong With Excel’s Stacked Column Chart  This is my 2nd post on BP Oil Statistical Review of World Energy – June 2008, post 1 is here. In this post, I discuss Excel’s stacked column charts, using BP’s Regional Consumption Pattern  2007 as an example.           First, the good news. While I’m not sure what chart package BP used, this chart looks a lot like an Excel stacked column chart with some color, Y axis position and label enhancements.  The bad news is that BP used a stacked column chart which  is the Excel way of showing three variables on a 2D display. In this case, the variables are: Region of World, Fuel type and percent of energy use by fuel in that region. It is difficult to interpret the values for the internal fuels on the stacked column chart because they do not have a common baseline. Here’s the same data in an R Lattice chart. To me, the R Lattice – trellis chart helps me to see the patterns more clearly than the stacked column chart. Notice how Asia Pacific use of coal sticks out! S & C America have the largest portion of hydroelectric use. Natural gas is used widely, with Middle East having the greatest portion. Nuclear is relatively small, with Europe leading and N America  close behind. Finally, look at oil use, Middle East is greatest user, followed by S & C America and Africa.  Could you see these details in BP’s stacked column chart? Why Are Excel Chart Users Still Using Excel for Multivariate Charts If R is so good and free, then why are Excel charters still using Excel for multivariate charts?  For me, there are two reasons: 

  1. At first, I didn’t know any better. I knew about small multiples from Tufte’s writings, however, I didn’t know there was a free tool that could do trellis – lattice type small multiples.
  2. R Learning Curve  - Naomi Robbins book, Creating More Effective Graphs, introduced me to R. I got excited about R’s capabilities, however, I found the learning curve daunting. It was easier to slip back into comfortable Excel charts rather than learn a new – better way to make charts. 

R Lattice Flexibility In a comment to this post, Tony said ” .. I  typically like to see all of the charts either in a row or column so it’s easier to compare.” Here the lattice plot the way Tony prefers. The original 2 x 3 matrix was the default. by adding a simple layout control, I changed it to a 1x 6 display.  

Update Hadley Wickham, an R heavyweight (that’s a good thing), suggested in his comment that “.. you might also want to use the reorder function to reorder the factor levels in terms of the highest use”. Since it sounded like a good idea from a really experienced R programmer, I decided to give it a try. Here’s my revised chart based on Hadley’s suggested reorder of both the fuel and region factors.

I like it! The fuel panels are now sorted by median percent energy use, with nuclear the lowest and oil the highest. The regions are sorted by magnitude of oil use, with Africa at low end and N America at high end.

Update 2 In my 1st update, I sorted the panels by magnitude of energy use, however, I was not able to sort by regional energy use within panels. I tried several sorting, ordering and reordering approaches to no avail. I finally asked the R Graphics expert, Paul Murrell, the author of R Graphics for help. Thanks again Paul.

Here’s the plot the way I really wanted it.

 

Update 3

Reader Jaanus had an interesting comment:

“Whilst the charts look nice isn’t the fact that the x-axis doesn’t begin at 0 confusing the message?

Percentage of nuclear energy usage in Middle-East is not that intuitive…I would recommend forcing the x-axis to begin at 0.” 

Here’s the chart with the x-axis starting at 0.