{"id":13857972,"url":"https://github.com/uribo/sealr","last_synced_at":"2025-07-13T23:30:54.802Z","repository":{"id":75115090,"uuid":"124811415","full_name":"uribo/sealr","owner":"uribo","description":"🏭 Sealing the R Objects Test and Assert Conditions 🤖","archived":true,"fork":false,"pushed_at":"2019-07-03T23:53:15.000Z","size":1307,"stargazers_count":10,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-22T16:39:03.282Z","etag":null,"topics":["assertions","rstats","testing","testthat"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uribo.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-12T00:06:16.000Z","updated_at":"2023-05-10T14:44:06.000Z","dependencies_parsed_at":"2023-02-28T17:48:58.190Z","dependency_job_id":null,"html_url":"https://github.com/uribo/sealr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/uribo/sealr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uribo%2Fsealr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uribo%2Fsealr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uribo%2Fsealr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uribo%2Fsealr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uribo","download_url":"https://codeload.github.com/uribo/sealr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uribo%2Fsealr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265220145,"owners_count":23729767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertions","rstats","testing","testthat"],"created_at":"2024-08-05T03:01:52.780Z","updated_at":"2025-07-13T23:30:54.794Z","avatar_url":"https://github.com/uribo.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n# sealr \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"120px\" /\u003e\n\n[![CRAN\\_Status\\_Badge](http://www.r-pkg.org/badges/version/sealr)](https://cran.r-project.org/package=sealr)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/sealr?color=FF5254)](https://cran.r-project.org/package=sealr) [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.1.0-blue.svg)](https://cran.r-project.org/) [![Depsy](http://depsy.org/api/package/cran/sealr/badge.svg)](http://depsy.org/package/r/sealr) \n\n[![Travis build status](https://travis-ci.org/uribo/sealr.svg?branch=master)](https://travis-ci.org/uribo/sealr) [![Coverage status](https://codecov.io/gh/uribo/sealr/branch/master/graph/badge.svg)](https://codecov.io/github/uribo/sealr?branch=master)\n \n[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg?style=for-the-badge)](https://www.tidyverse.org/lifecycle/#experimental) [![npm](https://img.shields.io/npm/l/express.svg?style=for-the-badge)](https://github.com/uribo/sealr)\n\n## Motivation\n\n![](man/figures/sealr_introduction.png)\n\nData is not always what you think. Someone may change a single value or the data type may be different depending on the specification the API. We need to be aware of these data changes as soon as possible (*It is hard to review from the final result!*).\n\nYou can use tests and asserts to check data behavior. Although the testthat package is originally used for unit test of R package, this framework is wide and applicable to any *R* object. On the other hand, it is time-consuming task to enter the state of existing objects, and there is a possibility of mistakes as well.\n\nThe goal of **sealr** is to reduce the burden of writing unit tests and assertion that record the state of objects. Applying a function of sealr to the target object outputs the test code that record the current state.\n\n## Installation\n\n**sealr** is available on CRAN.\n\n```{r, eval = FALSE, echo = TRUE}\ninstall.packages(\"sealr\")\n```\n\nFor developers, install from GitHub.\n\n```{r, eval = FALSE, echo = TRUE}\ninstall.packages(\"devtools\")\ndevtools::install_github(\"uribo/sealr\")\n```\n\n## How to use\n\n1. (As usual) Create an *R* object.\n2. Execute the function of sealr (`design_*()` or `transcribe()`) against a object whose state is to be record.\n    - `design_*()`... The preamble is fixed and consists of the function name bearing test items (eg. `design_class()`, `design_length()`, etc.).\n    - `transcribe()`... Sets of `design_*()`.It is a generic function and returns combinations according to the class of the object.\n\n```{r, eval = TRUE, echo = TRUE}\nlibrary(sealr)\nlibrary(testthat)\n```\n\n```{r}\nx \u003c- seq(1, 9, by = 2)\n\ndesign_class(x, seal = TRUE)\n\ndesign_range(x, seal = TRUE)\n```\n\nYou can copy the output, but if you activate the *clip* argument, the output result will be in a copied state, pasting that value is too easy. This feature depends on the [clipr](https://github.com/mdlincoln/clipr) package.\n\n```{r, eval = FALSE, echo = TRUE}\ndesign_class(x, seal = TRUE, clip = TRUE)\nexpect_is(\n  x,\n  \"numeric\"\n)\n```\n\n`transcribe()` is a generic function that produces output according to the class of the object. Currently it suports to 8 classes, but we plan to add various classes in future upgrades.\n\n```{r, warning = FALSE}\ntranscribe(iris)\n\nmy_data \u003c- list(A = letters, B = trees)\n\ntranscribe(my_data, load_testthat = FALSE, ts = FALSE)\n```\n\nTo get started, please read our [introduce vignette](vignettes/sealr1.Rmd).\n\n## Related projects on the test and assertion\n\n- [assertr](https://github.com/ropensci/assertr)\n- [checkmate](https://github.com/mllg/checkmate)\n- [checkr](https://github.com/poissonconsulting/checkr)\n- [validate](https://github.com/data-cleaning/validate)\n- [ruler](https://github.com/echasnovski/ruler)\n\n## Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md).\n\nBy participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furibo%2Fsealr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furibo%2Fsealr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furibo%2Fsealr/lists"}