e834b20828fc043ecd0b470de7444e90fe76e6d211b0104490f1c1_640_map-united-states

Map Projections for R Shapefiles: United States

Someone contacted me recently about the map projections used in my blscrapeR package. After a bit of web searching, I couldn’t find a really good list of map projections for the continental U.S. that could be used in R. This list is as much for my own reference as anyone else, but hope you find Read More

blscrape_docfig3

Using blscrapeR to Map County Unemployment Data

The blscrapeR package makes it easy to produce choropleth maps of various employment and unemployment rates from the Bureau of Labor Statistics (BLS.) Install blscrapeR from CRAN: install.packages(“blscrapeR”) It’s easy enough to pull a metric for a certain county. The code below pulls the unemployment rates for Orange County, FL from the BLS API. library(blscrapeR) Read More

fips_map

Mapping US Counties in R with FIPS

Anyone who’s spent any time around data knows primary keys are your friend. Enter the FIPS code. FIPS is the Federal Information Processing Standard and appears in most data sets published by the US government. Name Matching The map below is an example as the “wrong way” to do something like this. This map uses Read More

googlemapsmain

Detailed Geo Viz with Tableau, Mapbox and Google Street View

Tableau + Google Maps This has been one of my favorite Tableau tricks for a while. I originally saw Ben Jones do this a few years back but I think the Mapbox integration takes it to a whole new level. DISCLAIMER: from time to time, Google has been known to change their API, which inevitably breaks Read More

shiny-server-alive

Install Shiny Server for R on Ubuntu the Right Way

Is it time to spin up a new instance of Shiny Server? This tutorial is baseed on a fresh install of Ubuntu Server 14.04, but I’m sure it could be tweaked to work on RHEL or CentOS as well. There’s no real secret sauce to the install but there are several “gotcha’s” that most people Read More

actualvspredicted3

How To Forecast With Tableau And R

After working with Tableau for the last several years, I have to admit that I’m quite impressed with the statistical capabilities of the software. It’s nowhere near the analytical powerhouse that R is, but for visualization it does a pretty good job. As good as Tableau is, much of the statistical properties are “out of Read More

11-30-2014 9-24-53 AM

Visualizing Batting Stats: Linear Regression

A couple of months back I wrote an article on why batting average is obsolete as an offensive metric in baseball. The argument was based off of a linear regression analysis of several other advanced metrics and used the coefficient of determination or “” to measure the results. I finally got around to properly visualizing Read More

9331179092_7875dc075c_baseball-pitcher

Cool things to do with pitchRx in R Studio (Part 1)

I recently wrote a post on how to collect MLB game day data using the pitchRx package in R and collect that data into a Sqlite database. Data scraping is fun but all the data in the world is useless unless you can do something with it. The real power of pitchRx, in my opinion, Read More

4620993737_cd4380ae0d_baseball

How to Calculate Wins Above Replacement with the openWAR R Package

I recently posted an article on how to install the openWAR package in R. The article was so popular, Tom Tango himself (or one of his staff) linked it directly to the Tangotiger blog! To follow-up I thought I’d post a few tricks on things you can do with openWAR once you’ve actually got it Read More

Rplot_RC

Analyzing Bill James’ Runs Created and Player Salaries

With salaries in Major League Baseball soaring past $30 million per season, one tends to wonder, what salary range gives MLB clubs the best bang for the buck? Bill James, who is widely considered the father of sabermetrics, created a formula a while back called Runs Created (RC). The general principal of RC is to Read More