Foreword xiii Preface xv Acknowledgments xix About the Author xxiii Getting R 1 1.1 Downloading R 1 1.2 R Version 2 1.3 32-bit versus 64-bit 2 1.4 Installing 2 1.5 Revolution R Community Edition 10 1.6 Conclusion 11 The R Environment 13 2.1 Command Line Interface 14 2.2 RStudio 15 2.3 Revolution Analytics RPE 26… Continue reading

This page is dedicated to R for Everyone: Advanced Analytics and Graphics, my book from Addison Wesley, now in its Second Edition.  Here you will find links to information from the book including the table of contents, packages used, data and corrections.  It will be updated over time so keep coming back. Available for purchase… Continue reading

For a d3 bar plot visit https://www.jaredlander.com/plots/PizzaPollPlot.html. I finally compiled the data from all the pizza polling I’ve been doing at the New York R meetups. The data are available as json at https://www.jaredlander.com/data/PizzaPollData.php. This is easy enough to plot in R using ggplot2. require(rjson) require(plyr) pizzaJson <- fromJSON(file = “http://jaredlander.com/data/PizzaPollData.php”) pizza <- ldply(pizzaJson, as.data.frame)… Continue reading

The wonderful people at Gilt are having me teach an introductory course on R this Friday. The class starts with the very basics such as variable types, vectors, data.frames and matrices.  After that we explore munging data with aggregate, plyr and reshape2.  Once the data is prepared we will use ggplot2 to visualize it and then… Continue reading

Michael Malecki recently shared a link to a Business Insider article that discussed the Monty Hall Problem. The problem starts with three doors, one of which has a car and two of which have a goat. You choose one door at random and then the host reveals one door (not the one you chose) that… Continue reading

Given the warnings for today’s winter storm, or lack of panic, I thought it would be a good time to plot the NYC evacuation maps using R. Of course these are already available online, provided by the city, but why not build them in R as well? I obtained the shapefiles from NYC Open Data… Continue reading

Continuing with the newly available football data (new link) and inspired by a question from Drew Conway I decided to look at play selection based on down by the Giants for the past 10 years. Visually, we see that until 2011 the Giants preferred to run on first and second down.  Third down is usually a do-or-die down… Continue reading

A friend of mine has told me on numerous occasions that since 1960 the Yankees have not won a World Series while a Republican was President.  Upon hearing this my Republican friends (both Yankee and Red Sox fans) turn incredulous and say that this is ridiculous.  So I decided to investigate.  To be clear this… Continue reading

With tonight’s Mega Millions jackpot estimated to be over $640 million there are long lines of people waiting to buy tickets.  Of course you always hear about the probability of winning which is easy enough to calculate:  Five numbers ranging from 1 through 56 are drawn (without replacement) then a sixth ball is pulled from… Continue reading