exampletestr

An R package for help with writing unit tests based on examples in documentation. Slightly similar to python's doctests.

https://github.com/rorynolan/exampletestr

Science Score: 26.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
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.7%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

An R package for help with writing unit tests based on examples in documentation. Slightly similar to python's doctests.

Basic Info
Statistics
  • Stars: 37
  • Watchers: 1
  • Forks: 3
  • Open Issues: 0
  • Releases: 11
Created over 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Codemeta

README.Rmd

---
output: github_document
---

```{r knitr setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, comment = "#>")
```

# `exampletestr` 

An R package to help developers create unit tests (designed for use with the `testthat` package) for their package, based on the examples in their package documentation.

[![R-CMD-check](https://github.com/rorynolan/exampletestr/workflows/R-CMD-check/badge.svg)](https://github.com/rorynolan/exampletestr/actions)

![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)

[![CRAN status](https://www.r-pkg.org/badges/version/exampletestr)](https://cran.r-project.org/package=exampletestr)
[![RStudio CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/exampletestr)](http://cranlogs.r-pkg.org/badges/grand-total/exampletestr)
[![RStudio CRAN monthly downloads](http://cranlogs.r-pkg.org/badges/exampletestr)](http://cranlogs.r-pkg.org/badges/exampletestr)


## Installation

To install the release version from [CRAN](https://cran.r-project.org/package=exampletestr):
```{r Install-exampletestr, eval=FALSE}
install.packages("exampletestr")
```

To install the dev version from [GitHub](https://github.com/rorynolan/exampletestr):
```{r Install-dev-exampletestr, eval=FALSE}
remotes::install_github("rorynolan/exampletestr")
```


## Use

To learn how to use `exampletestr`, visit the package's website at https://rorynolan.github.io/exampletestr/.


## Contributing
The preferred method of contribution is via GitHub pull request. Please note that the `exampletestr` project is released with a [Contributor Code of Conduct](inst/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.
# Contribution
Contributions to this package are welcome. The preferred method of contribution is through a github pull request. Feel free to contact me by creating an issue. Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.

Owner

  • Name: Rory Nolan
  • Login: rorynolan
  • Kind: user
  • Location: Oakland, California.

Data scientist at mirvie.com. PhD in statistical image analysis.

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "exampletestr",
  "description": "Take the examples written in your documentation of functions and use them to create shells (skeletons which must be manually completed by the user) of test files to be tested with the 'testthat' package. Sort of like python 'doctests' for R.",
  "name": "exampletestr: Help for Writing Unit Tests Based on Function Examples",
  "relatedLink": [
    "https://rorynolan.github.io/exampletestr/",
    "https://CRAN.R-project.org/package=exampletestr"
  ],
  "codeRepository": "https://github.com/rorynolan/exampletestr",
  "issueTracker": "https://github.com/rorynolan/exampletestr/issues",
  "license": "https://spdx.org/licenses/GPL-3.0",
  "version": "1.7.3",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.4.0 (2024-04-24)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Rory",
      "familyName": "Nolan",
      "email": "rorynoolan@gmail.com",
      "@id": "https://orcid.org/0000-0002-5239-4043"
    }
  ],
  "contributor": [
    {
      "@type": "Person",
      "givenName": "Sergi",
      "familyName": "Padilla-Parra",
      "email": "spadilla@well.ox.ac.uk",
      "@id": "https://orcid.org/0000-0002-8010-9481"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Rory",
      "familyName": "Nolan",
      "email": "rorynoolan@gmail.com",
      "@id": "https://orcid.org/0000-0002-5239-4043"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "clipr",
      "name": "clipr",
      "version": ">= 0.7",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=clipr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "crayon",
      "name": "crayon",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=crayon"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "pacman",
      "name": "pacman",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=pacman"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "spelling",
      "name": "spelling",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=spelling"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "version": ">= 2.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "R",
      "name": "R",
      "version": ">= 3.5"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "checkmate",
      "name": "checkmate",
      "version": ">= 2.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=checkmate"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "fs",
      "name": "fs",
      "version": ">= 1.5",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=fs"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "magrittr",
      "name": "magrittr",
      "version": ">= 1.5",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=magrittr"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "purrr",
      "name": "purrr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=purrr"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "readr",
      "name": "readr",
      "version": ">= 2.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=readr"
    },
    "7": {
      "@type": "SoftwareApplication",
      "identifier": "rlang",
      "name": "rlang",
      "version": ">= 0.4",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rlang"
    },
    "8": {
      "@type": "SoftwareApplication",
      "identifier": "roxygen2",
      "name": "roxygen2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=roxygen2"
    },
    "9": {
      "@type": "SoftwareApplication",
      "identifier": "rstudioapi",
      "name": "rstudioapi",
      "version": ">= 0.4",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rstudioapi"
    },
    "10": {
      "@type": "SoftwareApplication",
      "identifier": "strex",
      "name": "strex",
      "version": ">= 1.4.2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=strex"
    },
    "11": {
      "@type": "SoftwareApplication",
      "identifier": "stringr",
      "name": "stringr",
      "version": ">= 1.5",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=stringr"
    },
    "12": {
      "@type": "SoftwareApplication",
      "identifier": "styler",
      "name": "styler",
      "version": ">= 1.2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=styler"
    },
    "13": {
      "@type": "SoftwareApplication",
      "identifier": "usethis",
      "name": "usethis",
      "version": ">= 2.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=usethis"
    },
    "14": {
      "@type": "SoftwareApplication",
      "identifier": "withr",
      "name": "withr",
      "version": ">= 2.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=withr"
    },
    "SystemRequirements": null
  },
  "fileSize": "86.299KB",
  "citation": [
    {
      "@type": "ScholarlyArticle",
      "datePublished": "2017",
      "author": [
        {
          "@type": "Person",
          "givenName": "Rory",
          "familyName": "Nolan"
        },
        {
          "@type": "Person",
          "givenName": "Sergi",
          "familyName": "Padilla-Parra"
        }
      ],
      "name": "exampletestr - An easy start to unit testing R packages",
      "identifier": "10.12688/wellcomeopenres.11635.2",
      "pagination": "31",
      "@id": "https://doi.org/10.12688/wellcomeopenres.11635.2",
      "sameAs": "https://doi.org/10.12688/wellcomeopenres.11635.2",
      "isPartOf": {
        "@type": "PublicationIssue",
        "datePublished": "2017",
        "isPartOf": {
          "@type": [
            "PublicationVolume",
            "Periodical"
          ],
          "volumeNumber": "2",
          "name": "Wellcome Open Research"
        }
      }
    }
  ],
  "releaseNotes": "https://github.com/rorynolan/exampletestr/blob/master/NEWS.md",
  "readme": "https://github.com/rorynolan/exampletestr/blob/master/README.md",
  "contIntegration": "https://github.com/rorynolan/exampletestr/actions",
  "developmentStatus": "https://lifecycle.r-lib.org/articles/stages.html"
}

GitHub Events

Total
Last Year

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 137
  • Total Committers: 5
  • Avg Commits per committer: 27.4
  • Development Distribution Score (DDS): 0.036
Past Year
  • Commits: 8
  • Committers: 3
  • Avg Commits per committer: 2.667
  • Development Distribution Score (DDS): 0.375
Top Committers
Name Email Commits
Rory Nolan r****n@g****m 132
Rory Nolan r****y@m****m 2
Lorenz Walthert l****t@i****m 1
Andy Teucher a****r@g****m 1
Francisco Rodriguez-Sanchez f****c@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 9
  • Total pull requests: 4
  • Average time to close issues: 18 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 2.78
  • Average comments per pull request: 0.5
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 20 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rorynolan (4)
  • jennybc (3)
  • lorenzwalthert (1)
  • ateucher (1)
Pull Request Authors
  • lorenzwalthert (2)
  • Pakillo (1)
  • ateucher (1)
Top Labels
Issue Labels
enhancement (3) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 870 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 25
  • Total maintainers: 1
cran.r-project.org: exampletestr

Help for Writing Unit Tests Based on Function Examples

  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 870 Last month
Rankings
Stargazers count: 8.9%
Downloads: 18.9%
Forks count: 21.9%
Average: 23.0%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Maintainers (1)
Last synced: 9 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5 depends
  • checkmate >= 2.0 imports
  • fs >= 1.5 imports
  • magrittr >= 1.5 imports
  • ore >= 1.4 imports
  • purrr * imports
  • readr >= 2.0 imports
  • rlang >= 0.4 imports
  • roxygen2 * imports
  • rstudioapi >= 0.4 imports
  • strex >= 1.4.2 imports
  • stringr >= 1.4 imports
  • styler >= 1.2 imports
  • usethis >= 2.0 imports
  • withr >= 2.1 imports
  • clipr >= 0.7 suggests
  • covr * suggests
  • crayon * suggests
  • knitr * suggests
  • pacman * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat >= 2.1 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite