Skip to contents

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 = NULL,
  initial_comment = NULL,
  channels = Sys.getenv("SLACK_CHANNEL"),
  token = Sys.getenv("SLACK_TOKEN"),
  thread_ts = NULL,
  ...
)

Arguments

data

the data frame or tibble 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 of file.

initial_comment

The message text introducing the file in specified channels.

channels

Comma-separated list of channel names or IDs where the file will be shared.

token

Authentication token bearing required scopes.

thread_ts

Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead.

...

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

Author

Matt Kaye (aut)