Interactive plots in Shiny

I wish this post existed when I was struggling to add interactive plots to my Shiny app. I was mainly focused on recreating functionality found in other “dashboarding” applications. When looking for options, I found that htmlwidgets were the closest to what companies usually expect. However, while they are great for client-side interactivity, I often hit walls with them when I try to add click-through interactivity because the functionality is either not there, is very limited, or is bloated.

Read more

Share Comments · · · ·

GDP Data via API

Today, we will look at the GDP data that is released every quarter or so by the Bureau of Economic Analysis (BEA), and get familiar with the BEA API (see the documentation here). For a primer on GDP in general, BEA publishes this guide. To access the BEA API, we will need two packages, httr and jsonlite. library(tidyverse) library(tidyquant) library(httr) library(jsonlite) We also need to know the API address and parameters to get.

Read more

Share Comments · · ·

How to Build a Shiny "Truck"!

Why is this about trucks? Last month, at the R/Pharma conference that took place on the Harvard Campus, I presented bioWARP, a large Shiny application containing more than 500,000 lines of code. Although several other Shiny apps were presented at the conference, I noticed that none of them came close to being as big as bioWARP. And I asked myself, why? I concluded that most people just don’t need to build them that big!

Read more

Share Comments · ·

Slack and Plumber, Part One

In the previous post, we introduced plumber as a way to expose R processes and programs to external systems via REST API endpoints. In this post, we’ll go further by building out an API that powers a Slack slash command, all from within R using plumber. A subsequent post will outline deploying and securing the API. We will create an API built on top of simulated customer call data that powers a slash command.

Read more

Share Comments · · · ·

July 2018: Top 40 New Packages

July was a big month for submitting new packages to CRAN; by my count, 251 unique and truly new packages were accepted. In addition to quantity, I was pleased to see quality and variety. For instance, tropicalSparse, a package for exploring some abstract mathematics, and eChem, a package for teaching analytical chemistry, exemplify R’s expansion into new fields. Below are my “Top 40” picks organized into ten categories: Computational Methods, Data, Econometrics, Machine Learning, Mathematics, Science, Statistics, Time Series, Utilities, and Visualization

Read more

Share Comments · ·

Learning Analytic Administration through a Sandbox

It all starts with sandboxes. Development sandboxes are dedicated safe spaces for experimentation and creativity. A sandbox is a place where you can go to test and break things, without the ramifications of breaking the real, important things. If you’re an analytic administrator who doesn’t have access or means to get a sandbox, I recommend that you consider advocating to change that. Here are just some of the arguments for why sandboxes are a powerful tool for the R admin that you may find helpful.

Read more

Share Comments · · ·

TokyoR #71

Last month, I was delighted to be invited to speak, along with Hadley Wickham, at the seventy-first meeting of the TokyoR user group in Tokyo, Japan. This day-long mini-conference attracted more than 200 attendees and featured 16 talks that covered a wide range of topics, including two near-real-time analyses of World Cup Soccer games (here and here) and an analysis of wind direction with circular data and autogressive processes (here). The tone of the talks ranged from light-hearted to business-serious.

Read more

Share Comments · · ·

Highcharting Jobs Friday

Today, in honor of last week’s jobs report from the Bureau of Labor Statistics (BLS), we will visualize jobs data with ggplot2 and then, more extensively with highcharter. Our aim is to explore highcharter and its similarity with ggplot and to create some nice interactive visualizations.

Read more

Share Comments · ·

Two Big Ideas from JSM 2018

The Joint Statistical Meetings offer an astounding number of talks. It is impossible for an individual to see more than a small portion of what is going on. Even so, a diligent attendee ought to come away with more than a few good ideas. The following are two big ideas that I got from the conference. Session 149, an invited panel on Theory versus Practice which featured an All-Star team of panelists (Edward George, Trevor Hastie, Elizaveta Levina, John Petkau, Nancy Reid, Richard J Samworth, Robert Tibshirani, Larry Wasserman and Bin Yu), covered a lot of ground and wove a rich tapestry of ideas.

Read more

Share Comments ·

June 2018: Top 40 New Packages

Approximately 144 new packages stuck to CRAN in June. That fact that 31 of these are specialized to particular scientific disciplines or analyses provides some evidence to my hypothesis that working scientists are actively adopting R. Below are my Top 40 picks for June, organized into the categories of Computational Methods, Data, Data Science, Economics, Science, Statistics, Time Series, Utilities and Visualizations. The Data packages, especially rtrek and opensensmapr, look like they have some interesting new data to explore.

Read more

Share Comments · · ·