May 19, 2013

THT Essentials:
Fangraphs Player Search:


And here's the full roster.

Now available


You can now purchase the Hardball Times Baseball Annual 2013, with 300 pages of great content. It's also available on Amazon and Kindle. Read more about it here.

THT's latest e-book


Third Base: The Crossroads is THT's new e-book, available for $3.99 from the Kindle store. The good news is that anyone can read a Kindle book, even on a PC. So enjoy the best from THT in a new format.

Most Recent Comments





Get your very own THT merchandise from our CafePress store. We've got baseball caps, t-shirts, coffee mugs and even wall clocks with the classy THT logo prominently displayed. Also, check out the THT Bookstore. Please support your favorite baseball site by purchasing something today.



Or you can search by:


Creative Commons License
All content on this site (including text, graphs, and any other original works), unless otherwise noted, is licensed under a Creative Commons License.
Roll mouse over date for entries
THT Live Calendar
May 2013
S M T W T F S



1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Monday, December 13, 2010

Creating Baseball Graphics Using R

Posted by Ricky Zanker
Ever wanted to create "heat maps" like this. Or line graphs like this. Now here's you chance!

These graphics are made through the freely available software simply called R. A powerful software used by scientists, R can be a daunting program to use with its command-line interface that might not be too friendly to those who are justing getting by with Microsoft Excel. Plus there is a lot of code to learn in order to do the most basic functions. I am certain there are many people out there who are willing to learn how to make these graphics with R but they don't know where to start. This is where I come in.

Starting this week, I will write a series of tutorial articles here at THT Live explaining how to use the R system, import data, write code, and make those awesome graphics. Most of the graphs and functions I will use will pertain to the very popular pitch f/x from MLB Advanced Media. A large amount of pitch f/x data is easy to come by now using the awesome web tool by Joe Lefkowitz so no database required. Also note that the series is not called "Pitch f/x Graphics" since I will try to find some things to do that don't involve pitch f/x data. Another thing to note is that I am no R expert and I have only used it for baseball data. There may be easier ways to do certain things. But this also means that I shouldn't be too overly complicated either. If you have any ideas of what I should cover over the course of the series, please comment away or shoot me an email.

Before you leave, let's start with the most basic step of this process by downloading the R software. Go to http://cran.r-project.org/ and click your Operating System (I will be using Windows). For Windows users, click the base package. Mac users, click the file named R-2.12.0.pkg. And if you are using Linux, download the tar.gz file on the homepage. After the file is downloaded, follow the instructions for installation. And now your done.

For next time, I will go over the basic interface of the R software and how to download packages.




Ricky Zanker also writes for Draysbay and can be contacted by email.


Comments

Albert Lyu said...

Looking forward to this. If even a fraction of the online baseball community can learn the basics of R, we would have all sorts of awesome heat map analysis.

Posted 12/13  at  03:53 PM
Sam said...

I am really excited for this.  R is a really awesome software that not enough people know how to use.  Encouraging more to learn it will make everyone better off.

Posted 12/13  at  04:15 PM
chisoxpurdue said...

I am glad for this.  I have dabbled in R a little for Statistical and Econometric Methods in Civil Engineering (transportation).  These tutorials will be very helpful for both my baseball analysis and graduate research.

Posted 12/13  at  11:00 PM
Page 1 of 1

Leave a comment:

Commenting is not available in this weblog entry.