slack_reprex: post reprex output to slack

Description Usage Arguments Details Value See Also Examples

View source: R/reprex.R

Description

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.

Usage

1
2
3
4
5
6
7
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")

Details

channel can be on of the following in an activated team

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

Value

response from slack api

See Also

reprex

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
if(interactive()){

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

## End(Not run)

yonicd/slackreprex documentation built on Sept. 20, 2020, 3:54 a.m.