PlotToSlack: Post ASCII of a ggplot to Slack

Description Usage Arguments Value

View source: R/ascii.R

Description

Given a ggplot, rasterize it, turn it into ASCII, and post it to Slack.

Usage

1
2
3
PlotToSlack(p, characters = c("codeblock", "emoji"), width = NULL,
  channelName, botName = NULL,
  webhookURL = Sys.getenv("SLACK_WEBHOOK"))

Arguments

p

A ggplot object. Currently works best if it's monochromatic.

characters

One of these two options:

  • "codeblock" (default) - Plot in a backtick-surrounded code block. No emojis but higher resolution is possible.

  • "emoji" - Plot in emojis. Lower resolution but more fun.

width

The width of the plot in number of characters. Default is 60 for "codeblock" and 30 for "emoji".

channelName

A string of the form "@username" or "#channelname". When using "@username", log messages will be sent through Slackbot to that user. When using "#channelname", log messages will be posted to that channel as a bot.

botName

A string of the name of the bot that posts. Default is NULL, which means to use the default bot name that was set up with the Incoming Webhook. See References.

webhookURL

A string of the Slack webhook URL of the form "https://hooks.slack.com/services/XXX/YYY/ZZZ". Default reads the environment variable SLACK_WEBHOOK. See References.

Value

Result of the POST call.


austin3dickey/slaph documentation built on May 3, 2019, 3:13 p.m.