Publications by Kris Eberwein
How to Use R to Scrape Tweets: Super Tuesday 2016
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 Twitter-verse was saying about the candidates during last night�...
2482 sym R (2945 sym/5 pcs)
Add Authentication to Shiny Server with Nginx
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 this little problem, I whipped up two work-arounds. One solution uses...
3491 sym Python (2489 sym/13 pcs) 4 img
How to Install R on Linux Ubuntu 16.04 Xenial Xerus
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 R-Base in the Software Center; this would be the easy way to ...
1838 sym R (503 sym/5 pcs) 2 img
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 a string matching technique t...
2542 sym 4 img
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 ...
2940 sym R (1686 sym/7 pcs) 6 img
Calculate Wages and Benefits in R with blscrapeR
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 databases. Install blscrapeR The first step in analy...
2404 sym R (3431 sym/10 pcs) 2 img
Use R to Calculate Inflation with the blscrapeR Package
The Consumer Price Index (CPI) is the main standard for tracking the inflation of the U.S. dollar. The various CPI measures are published monthly by the Bureau of Labor Statistics. For this walk-through, we will be using the blcsrapeR package to download our data from the BLS and perform the calculation. The blscrapeR package can be installed vi...
2523 sym R (644 sym/3 pcs) 2 img
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 it useful. Here’s my list of map projections tha...
1346 sym R (1261 sym/6 pcs) 12 img
Labor Market Analysis with R: Will Obama Ever be Beat?
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 over the labor market is up for debate. Befo...
849 sym R (803 sym/3 pcs) 6 img