knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
slackposts
is a part of slackverse
pkgs <- sprintf('slack%s',c('calls','teams','posts','blocks','threads','reprex')) badges <- sprintf('%s<br>[![](https://github.com/yonicd/%s/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/yonicd/%s)',pkgs,pkgs,pkgs) names(badges) <- pkgs
||||
|:-:|:-:|:-:|
||r badges[pkgs[1]]
||
|r badges[pkgs[5]]
|r badges[pkgs[2]]
|r badges[pkgs[3]]
|
|||r badges[pkgs[4]]
|
|||r badges[pkgs[6]]
|
slackposts
is an R
package that allows the user to interact with slack API chat messages, snippets and files from R.
remotes::install_github("yonicd/slackposts")
First you need a Slack API Token, to learn how to create one go to slackteams or set it directly as the environment variable Sys.setenv('SLACK_API_TOKEN')
.
library(slackposts)
chat_post( channels = "general", text = 'my message' )
chat_update( post = slackposts::post_last(), text = 'my updated message' )
chat_delete( post = slackposts::post_last() )
tf <- tempfile(fileext = '.r') cat( utils::capture.output(utils::sessionInfo()), file = tf, sep = '\n' )
file_post( channels = "general", file = tf, filename = 'sessionInfo.R', filetype = 'r', title = 'R sessionInfo' )
file_delete(file_last())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.