Learn R Programming

slackr (version 1.2)

dev.slackr: Send the graphics contents of the current device to a slack.com channel

Description

dev.slackr sends the graphics contents of the current device to the specified slack.com channel. This requires setting up a full API token (i.e. not a webhook & not OAuth) for this to work.

Usage

dev.slackr(channels = Sys.getenv("SLACK_CHANNEL"), ...,
  api_token = Sys.getenv("SLACK_API_TOKEN"))

Arguments

channels
list of channels to post image to
...
other arguments passed into png device
api_token
the slack.com full API token (chr)

Value

  • httr response object from POST call

See Also

slackrSetup, save.slackr, slackrUpload

Examples

Run this code
slackrSetup()

# ggplot
library(ggplot2)
qplot(mpg, wt, data=mtcars)
dev.slackr("#results")

# base
barplot(VADeaths)
dev.slackr("@jayjacobs")

Run the code above in your browser using DataLab