Learn R Programming

slackr (version 2.3.0)

slackr_csv: Send a data frame to Slack as a CSV

Description

slackr_csv simplifies the process of sending a data frame to Slack as a CSV file. It is highly recommended to leave the filename argument as the default (tempfile), as changing it will persist a csv file in your working directory.

Usage

slackr_csv(
  data,
  filename = tempfile(fileext = ".csv"),
  title = basename(filename),
  initial_comment = basename(filename),
  channels = Sys.getenv("SLACK_CHANNEL"),
  bot_user_oauth_token = Sys.getenv("SLACK_BOT_USER_OAUTH_TOKEN"),
  ...
)

Arguments

data

the data frame to upload

filename

the file to save to. Defaults to a tempfile. Using the default is highly advised, as using a non-tempfile will write a file that persists on the disk (either in the working directory, or at the location specified)

title

title on Slack (optional - defaults to filename)

initial_comment

comment for file on slack (optional - defaults to filename)

channels

Slack channels to save to (optional)

bot_user_oauth_token

Slack bot user OAuth token

...

additional arguments to be passed to write.csv()

Value

httr response object from POST call (invisibly)

httr response object from POST call (invisibly)

See Also

slackr_upload()