Articles by Kris Eberwein

Labor Market Analysis with R: Will Obama Ever be Beat?

February 13, 2017 | Kris Eberwein

No matter how many jobs are promised, Barak Obama’s administration will be nearly impossible to beat when it comes to employment growth. The following code uses the blcrapeR package, which is available on CRAN. Politicians talk a lot about jobs and unemployment, even though the actual power they have ...
[Read more...]

Calculate Wages and Benefits in R with blscrapeR

August 16, 2016 | Kris Eberwein

The most difficult thing about working with BLS data is gaining a clear understanding on what data are available and what they represent. Some of the more popular data sets can be found on the BLS Databases, Tables & Calculations website. The selected examples below do not include all series or ...
[Read more...]

Using blscrapeR to Map County Unemployment Data

August 1, 2016 | Kris Eberwein

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 ...
[Read more...]

Mapping US Counties in R with FIPS

June 16, 2016 | Kris Eberwein

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 ...
[Read more...]

How to Install R on Linux Ubuntu 16.04 Xenial Xerus

April 26, 2016 | Kris Eberwein

The long-awaited new Ubuntu LTS Xenial Xerus was released last week. I wrote a tutorial on installing R and R-Studio on the old 14.04 LTS, so I figured I’d update that document. Not much has changed for the new 16.04 version but there are new repositories. Install R-Base You can find ...
[Read more...]

Add Authentication to Shiny Server with Nginx

March 9, 2016 | Kris Eberwein

Shiny Server is a great tool, but I’ve always found it odd that there was no built-in password authentication. Sure, the Shiny Pro edition has SSL auth., but even for open source projects, I’m not really crazy about just anyone hitting my server whenever they want. To solve ... [Read more...]

How to Use R to Scrape Tweets: Super Tuesday 2016

March 2, 2016 | Kris Eberwein

Super Tuesday 2016 has come and gone, we have most of the election results, but what were the American public saying on Twitter? The twitteR package for R allows you to scrape tweets from Twitter’s API and use them to form sentiment analysis. The Plotly chart below shows what the ... [Read more...]

How to Pimp Your .Rprofile

December 30, 2015 | Kris Eberwein

After you’ve been using R for a little bit, you start to notice people talking about their .Rprofile as if it’s some mythical being. Nothing magical about it, but it can be a big time-saver if you find yourself typing things like, “summary()” or, the ever-hated, “stringasfactors=FALSE” ... [Read more...]

Upgrade R on Windows with the installr Package

December 16, 2015 | Kris Eberwein

It’s that time again—time for a new R version! The latest version 3.2.3 “Wooden Christmas Tree” is a small upgrade for most, but a huge step for Windows users. Of the new features included in Wooden, half of them are Windows-specific. Several months back I wrote a tutorial on ... [Read more...]

Calculate Inflation with R

December 1, 2015 | Kris Eberwein

I was surprised to see there weren’t more of these types of calculators in the R community. Inflation and adjusted payments seem like they would be more common. I was able to find a way to gather Consumer Price Index data using the quantmod package but quantmod leaves you ... [Read more...]

Data Science Workbench for Ubuntu 14.04

October 30, 2015 | Kris Eberwein

I found myself installing the same things over and over again on my VMs, so I decided to pack all my good DSR workbench action into one giant shell script that I could run and walk away from. Below is my markdown file, you can grab the shell scripts at ... [Read more...]

Hacking The New Lahman Package 4.0-1 with R-Studio

September 30, 2015 | Kris Eberwein

The developers of the Lahman package for R have recently updated the package to include 2014 MLB stats! For those not familiar, this R package recreates Sean Lahman’s Baseball Database into a quick and handy little R package. I’ve written on the Lahman package before, and even suggested adding ... [Read more...]

How To Forecast With Tableau And R

July 1, 2015 | Kris Eberwein

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 ... [Read more...]

How to Add WAR Metrics to your Lahman Database

April 30, 2015 | Kris Eberwein

I get a lot of questions on how to calculate WAR in the Lahman database. In the past I’ve discussed ways to calculate wOBA and FIP in Lahman but WAR has always been difficult due to the “closed-source” nature of the calculation. But there is an answer While stumbling ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)