Sharon Machlis

Get API data with R

There are a lot of great R packages that let you import data from an API with a single function. However, sometimes an API doesn’t have an already-written function. The good news is that it’s easy to code your own.
I’ll demonstrate this with the AccuWe…

“Do More with R” video tutorials

“Do More with R” offers quick video tips on useful things you can do in the R programming language. Now you can search these R tutorial videos by topics, tasks, and packages in the table below. (Click on the task to go straight to the video content—or …

Warehouse Discounts

How to write your own ggplot2 functions in R

Tidyverse packages like ggplot2 and dplyr have a function syntax that is usually pretty handy: You don’t have to put column names in quotation marks. For example: 
dplyr::filter(mtcars, mpg > 30)
Note the column name, mpg, is unquoted.
That fea…

How to use .SD in the R data.table package

For some data.table users, “dot-SD” is a bit of a mystery. But data.table creator Matt Dowle told me that it’s actually quite simple: Just think of it as a symbol representing “each group.” Let’s go through a couple of examples.

[embedded content]

I …

How to calculate month-over-month changes in R

If you need to calculate changes such as last month versus the prior month or last month versus the same month a year earlier, R is a good choice. It’s easy to do those calculations — and you don’t have to worry whether a spreadsheet formula was proper…

Warehouse Discounts

How to Slack from R

Using R to send a Slack message may sound like a parlor trick, but there are actually a lot of cases where that could come in handy. I’ve used Slack to send graphs to colleagues showing the latest web analytics trends. You can also use Slack to notify …