Converts reprex output to slackblocks and posts the blocks to a slack conversation which can be a channel, a direct message, a group message or a thread in one of them.

slack_reprex(
  ...,
  text = NULL,
  channel = NULL,
  ts = NULL,
  token = Sys.getenv("SLACK_API_TOKEN")
)

Arguments

...

code to evaluate in reprex

text

question text to attach to the reprex blocks

channel

character, channel to post to

ts

character, Slack API time stamp, Default: NULL

token

Slack API token, Default: Sys.getenv("SLACK_API_TOKEN")

Value

response from slack api

Details

channel can be on of the following in an activated team

  • name of channel

  • channel id

  • link to a message in a channel, direct message or a group message

A pairing of channel and ts can be used instead of a link to post to a thread.

See also

Examples

if (FALSE) { if(interactive()){ slack_reprex({ x <- 10 hist(runif(x)) hist(runif(2*y)) }, text = 'My question is ... ', channel = 'slackbot') } }