slap

Slap Light Alternative Plight

https://github.com/tadascience/slap

Science Score: 13.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.8%) to scientific vocabulary

Keywords

bat batman error-handling r slap
Last synced: 6 months ago · JSON representation

Repository

Slap Light Alternative Plight

Basic Info
  • Host: GitHub
  • Owner: tadascience
  • License: other
  • Language: R
  • Default Branch: main
  • Homepage: http://slap.tada.science/
  • Size: 1.37 MB
Statistics
  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
bat batman error-handling r slap
Created almost 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# slap 


[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/slap)](https://CRAN.R-project.org/package=slap)
[![R-CMD-check](https://github.com/tadascience/slap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tadascience/slap/actions/workflows/R-CMD-check.yaml)


The goal of slap is simplify error handling. 

## Installation

``` r
pak::pak("tadascience/slap")
```

## Example

```{r, eval = FALSE}
library(dplyr)
library(slap)

# suppose you have a function that throws an error
boom <- function() stop("An error occured in boom()")
# and you want to use it in e.g. dplyr::summarise()
# summarise(mtcars, mpg = boom())

# if you want to catch it and rethrow an error that is more
# meaningful to you, one way is to use withCallingHandlers()
withCallingHandlers(
  summarise(mtcars, mpg = boom()), 
  error = function(err) {
    cli::cli_abort("ouch", parent = err)
  }
)

# but that's kind of boring, so instead you can use the 
# slap operator %!% to slap away the eror
summarise(mtcars, mpg = boom()) %!% "ouch"

# or the double slap operator %!!% if you don't want to keep the parent error
summarise(mtcars, mpg = boom()) %!!% "ouch" 
```

Owner

  • Name: tadascience
  • Login: tadascience
  • Kind: organization

GitHub Events

Total
Last Year

Packages

  • Total packages: 1
  • Total downloads:
    • cran 148 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: slap

Simplified Error Handling

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 148 Last month
Rankings
Dependent packages count: 27.8%
Forks count: 28.7%
Dependent repos count: 35.7%
Stargazers count: 35.8%
Average: 42.6%
Downloads: 84.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • cli * imports
  • rlang * imports
  • testthat >= 3.0.0 suggests