https://github.com/mrkaye97/slackr

An R package for sending messages from R to Slack

https://github.com/mrkaye97/slackr

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 25 committers (4.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (20.5%) to scientific vocabulary

Keywords

r rstats slack

Keywords from Contributors

ggplot-extension ggplot2-scales visualisation geom ggplot2-geom documentation-tool setup
Last synced: 5 months ago · JSON representation

Repository

An R package for sending messages from R to Slack

Basic Info
Statistics
  • Stars: 304
  • Watchers: 15
  • Forks: 84
  • Open Issues: 4
  • Releases: 8
Topics
r rstats slack
Created over 11 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.Rmd

---
output: rmarkdown::github_document
---



```{r base, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
```

# slackr 


[![CRAN status](https://www.r-pkg.org/badges/version/slackr)](https://CRAN.R-project.org/package=slackr)
[![R-CMD-check](https://github.com/mrkaye97/slackr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mrkaye97/slackr/actions/workflows/R-CMD-check.yaml)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
![downloads](http://cranlogs.r-pkg.org/badges/grand-total/slackr)
[![codecov](https://codecov.io/gh/mrkaye97/slackr/branch/master/graph/badge.svg?token=5HjUtFfIJR)](https://codecov.io/gh/mrkaye97/slackr)



`slackr` provides a set of tools for making it easier to send messages, data, alerts, etc. directly from R to Slack. 
You can use this package to send well-formatted output from R to all teammates (or to specific individuals) at the same time 
with little effort. You can send text, R function output, images 
from the current graphics device and `ggplots`, R objects (as R data files), 
rendered LaTeX expressions, and uploaded files.

## Installation

```{r setup, eval=FALSE}
# CRAN version
install.packages("slackr")

# Development version
devtools::install_github("mrkaye97/slackr")
```


## Breaking Changes

Version `3.0.0+` removes all references to `bot_user_oauth_token` (deprecated in `v2.4.0`) in favor of `token`. There have also been significant changes to how `slackr` and `slackr_bot` handle errors. See [the changelog](https://matthewrkaye.com/slackr/news/index.html) for more details.

Version `2.4.0+` now allows users to choose between using a bot token and a user token. See below for details and check the changelog (`NEWS.md`) for more changes.


## Setup

There are three ways of interfacing with `slackr` that provide
significantly different functionality:

1. Creating a single-channel bot

    Using only a webhook to send messages to a channel


2.  Creating a fully-functional multi-channel bot

    Creating a bot user to send messages to multiple channels, including plots,
tables, files, etc. as well as deleting messages, reading the channels in a
workspace, etc.

3.  Using a user token to send messages from a specific user's account

    Similar to the fully-scoped bot token, but connected to the account of a single user. This approach is not recommended in production settings -- or any settings where a token needs to be shared -- but it can be useful for one-off Slack messages as it lets users send data as themselves as opposed to through a bot.
    
In most cases, we recommend `Option 1` above. This requires the fewest
permissions and is the simplest to set up, and will allow basic messaging to a
specific channel.

See the vignettes for setup instructions.


## Vignettes

The vignettes contain setup instructions and example usage:

* Option 1 setup: `vignette('scoped-bot-setup', package = 'slackr')`
* Option 2 setup: `vignette('webhook-setup', package = 'slackr')`
* Usage: `vignette('using-slackr', package = 'slackr')`

**Important Note:** The setup process for `Option 2` and `Option 3` are roughly the same, with only slightly differing scopes.

### Config File Setup

The `slackr_setup()` function will try to read setup values from a `~/.slackr` 
(you can change the default filepath by recording in the SLACKR_CONFIG_FILE_PATH 
environment variable or supplying as an argument to the `config_file` 
parameter) configuration file, which may be easier and more secure than passing 
them in manually (plus, will allow you to have multiple `slackr` configurations 
for multiple Slack.com teams).

The file is in Debian Control File (DCF) format since it really doesn't need to
be JSON and R has a handy `read.dcf()` function since that's what `DESCRIPTION`
files are coded in.

Here's the basic format for the configuration file:

```
token: xox*-
channel: #general
username: slackr
incoming_webhook_url: https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX
icon_emoji: 'boom'
```

**As of `slackr 2.3.0`, you can create a config file with `create_config_file()` instead of setting it up manually.** See the docs for details.

You can also change the default emoji icon (from the one you setup at
integration creation time) with `icon_emoji`.

## Contributors

Many thanks to:

- [Bob Rudis](https://github.com/hrbrmstr)
- [Jay Jacobs](https://github.com/jayjacobs)
- [David Severski](https://github.com/davidski)
- [Quinn Weber](https://github.com/qsweber)
- [Konrad Karczewski](https://github.com/konradjk)
- [Ed Niles](https://github.com/eniles)
- [Rick Saporta](https://github.com/rsaporta)
- [Jonathan Sidi](https://github.com/yonicd)
- [Matt Kaye](https://github.com/mrkaye97)
- [Xinye Li](https://github.com/xinye1)
- [Andrie de Vries](https://github.com/andrie)

for their contributions to the package!

## Known Issues

* Depending on your scopes, `slackr` could quietly fail (i.e. not throw an error, but also not post anything to your channel). If this happens, try explicitly adding the app you're trying to have `slackr` post as to the channel you want in your Slack workspace with `/invite @your_app_name` or make sure you have `chat:write.public` enabled.


Owner

  • Name: Matt Kaye
  • Login: mrkaye97
  • Kind: user
  • Location: Cambridge, MA
  • Company: @klaviyo

GitHub Events

Total
  • Issues event: 3
  • Watch event: 2
  • Issue comment event: 4
  • Push event: 4
  • Fork event: 3
Last Year
  • Issues event: 3
  • Watch event: 2
  • Issue comment event: 4
  • Push event: 4
  • Fork event: 3

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 536
  • Total Committers: 25
  • Avg Commits per committer: 21.44
  • Development Distribution Score (DDS): 0.272
Past Year
  • Commits: 85
  • Committers: 2
  • Avg Commits per committer: 42.5
  • Development Distribution Score (DDS): 0.035
Top Committers
Name Email Commits
mrkaye97 m****7@g****m 390
Bob Rudis b****b@r****t 50
Andrie a****s@g****m 32
Jonathan Sidi y****d@g****m 13
CJ Godfrey g****j@g****m 6
Xinye Li x****i@l****m 6
Gregory Jefferis j****s@g****m 5
qsweber q****r@g****m 4
jcrodriguez1989 j****z@u****r 3
Xinye Li l****e@g****m 3
Ildiko Czeller c****i@g****m 3
hrbrmstr b****7 3
boB Rudis b****b@r****s 3
Shinya Uryu s****7@g****m 2
Ananthapadmanabhan P a****l@g****m 2
raybuhr r****r@g****m 2
Jaehoon Jeong j****g@w****m 1
jayjacobs j****y@T****l 1
Rick Saporta r****a@g****m 1
shoili s****l@g****m 1
konradjk k****i@g****m 1
Javdat j****v@g****m 1
Ed Niles e****s@g****m 1
Jonathan Carroll j****o@j****u 1
mrchypark m****k@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 73
  • Total pull requests: 41
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 7 months
  • Total issue authors: 58
  • Total pull request authors: 14
  • Average comments per issue: 4.03
  • Average comments per pull request: 1.05
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 26 minutes
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.5
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mrkaye97 (10)
  • rkersey8208 (2)
  • davidski (2)
  • yonicd (2)
  • shabbychef (2)
  • botan (2)
  • marolopnaiba (2)
  • swoosh22 (1)
  • anthonypileggi (1)
  • mraess (1)
  • ronnyli (1)
  • nicoschreibt (1)
  • wagnerpinheiro (1)
  • calz1 (1)
  • adrian-pascual (1)
Pull Request Authors
  • mrkaye97 (25)
  • woowahan-jaehoon (2)
  • daroczig (2)
  • overmar (2)
  • czeildi (1)
  • sicarul (1)
  • muschellij2 (1)
  • calejero (1)
  • MeganBeckett (1)
  • katrinabrock (1)
  • jcrodriguez1989 (1)
  • botan (1)
  • ajzz (1)
  • MichaelChirico (1)
Top Labels
Issue Labels
wontfix (31) enhancement (17) bug (17) question (10) help wanted (3)
Pull Request Labels
wontfix (1)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 4,283 last-month
  • Total docker downloads: 23,322
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 8
    (may contain duplicates)
  • Total versions: 21
  • Total maintainers: 1
cran.r-project.org: slackr

Send Messages, Images, R Objects and Files to 'Slack' Channels/Users

  • Versions: 13
  • Dependent Packages: 1
  • Dependent Repositories: 8
  • Downloads: 4,283 Last month
  • Docker Downloads: 23,322
Rankings
Docker downloads count: 0.6%
Forks count: 0.7%
Downloads: 1.2%
Stargazers count: 1.3%
Average: 5.3%
Dependent repos count: 10.3%
Dependent packages count: 17.8%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/mrkaye97/slackr
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.3.0 depends
  • cachem >= 1.0.4 imports
  • dplyr * imports
  • ggplot2 * imports
  • grDevices * imports
  • graphics * imports
  • httr >= 1.4.2 imports
  • jsonlite * imports
  • magrittr * imports
  • memoise >= 2.0.0 imports
  • methods * imports
  • rlang * imports
  • tibble * imports
  • utils * imports
  • withr * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • svglite * suggests
  • testthat >= 3.0.0 suggests
  • texPreview * suggests