Create your own Slack bots -- and web APIs -- in R

This step-by-step tutorial will show you how to find a current stock price, but the basic framework can be used for all sorts of data

Become An Insider

Sign up now and get FREE access to hundreds of Insider articles, guides, reviews, interviews, blogs, and other premium content. Learn more.

One of Slack's greatest appeals is that it's so extensible. While its main purpose is group collaboration, add-on apps can do everything from answer questions about business analytics to offer project updates from tools like Jira and Trello.

R programming Thinkstock

And while there are dozens of pre-configured Slack bots from commercial third parties and open-source developers, it's not difficult to code your own.

There are already tutorials on how to do this in PHP and Python. But I wanted to take advantage of some R functions that easily import data about finance, weather, government information and more, and add some of that to what Slack calls "custom slash commands." These allow users to get responses to queries with simple formats like /weather or /stockprice.

Here's how I created a Slack custom slash command bot in R to retrieve current stock prices. The same techniques can be used for any other type of information you can import and process with R.

To continue reading this article register now