generics

Common generic methods

https://github.com/r-lib/generics

Science Score: 36.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
    1 of 10 committers (10.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary

Keywords from Contributors

tidy-data setup unit-testing parsing fwf csv s3-vectors string-interpolation tidyverse documentation-tool
Last synced: 10 months ago · JSON representation

Repository

Common generic methods

Basic Info
Statistics
  • Stars: 61
  • Watchers: 4
  • Forks: 13
  • Open Issues: 9
  • Releases: 5
Created about 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License Code of conduct

README.Rmd

---
output: github_document
---

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

# generics


[![R-CMD-check](https://github.com/r-lib/generics/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/generics/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/r-lib/generics/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/generics?branch=main)


`generics` is designed to help package authors reduce dependencies by providing a set of generic methods that can be imported. For example, if a package author wanted to include a `tidy` method for their object, they would have to import the `broom` package to do so. This would work but would potentially increase the number of package dependencies required to install and/or test the package. 

## Installation

To install `generics` from CRAN, use:

```{r, eval = FALSE}
install.packages("generics")
```

To install the development version, use:

```{r, eval = FALSE}
# install.packages("pak")
pak::pak("r-lib/generics")
```

## Usage

`generics` is a simple, lightweight package that contains S3 generics to be used by other packages. Some examples are:

```{r}
library(generics)

fit

tidy
```

To use `generics` with your package, we recommend that you import and re-export the generic(s) of interest. For example, if you want to provide a method for the  S3 `explain()` method, you'd using the following `roxygen2` code:

``` {r, eval = FALSE}
#' @importFrom generics explain
#' @export
generics::explain
```

As an example, the [recipes](https://github.com/tidymodels/recipes) package defines a number of `tidy()` S3 methods by importing this package (whereas it previously depended on `broom`). 

## Documentation

When searching for help on a method that is exported from `generics` by one or more packages, using `?method` will show entries for all exported methods. If the version from `generics` is selected, the Methods section dynamically lists all specific methods exported by any loaded packages. 

Owner

  • Name: R infrastructure
  • Login: r-lib
  • Kind: organization

GitHub Events

Total
  • Create event: 1
  • Release event: 1
  • Issues event: 3
  • Issue comment event: 1
  • Push event: 6
Last Year
  • Create event: 1
  • Release event: 1
  • Issues event: 3
  • Issue comment event: 1
  • Push event: 6

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 164
  • Total Committers: 10
  • Avg Commits per committer: 16.4
  • Development Distribution Score (DDS): 0.677
Past Year
  • Commits: 7
  • Committers: 1
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
DavisVaughan d****s@r****m 53
topepo m****n@g****m 51
Hadley Wickham h****m@g****m 40
Mitchell m****d@m****u 7
Hannah Frick h****h@r****m 5
alex hayes a****s@g****m 3
Mara Averick m****k@g****m 2
Jim Hester j****r@g****m 1
Ivan Svetunkov i****v@g****m 1
Daniel Possenriede p****e@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 45
  • Total pull requests: 35
  • Average time to close issues: 5 months
  • Average time to close pull requests: 16 days
  • Total issue authors: 24
  • Total pull request authors: 10
  • Average comments per issue: 1.42
  • Average comments per pull request: 0.89
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 0
  • Average time to close issues: 10 days
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 0
  • Average comments per issue: 0.33
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hadley (13)
  • DavisVaughan (8)
  • alexpghayes (2)
  • mitchelloharawild (2)
  • krivit (1)
  • joethorley (1)
  • juliasilge (1)
  • hs3434 (1)
  • egnha (1)
  • hfrick (1)
  • topepo (1)
  • oij11 (1)
  • vspinu (1)
  • jonocarroll (1)
  • RoelVerbelen (1)
Pull Request Authors
  • DavisVaughan (12)
  • topepo (8)
  • mitchelloharawild (3)
  • hfrick (3)
  • alexpghayes (2)
  • joethorley (2)
  • batpigandme (1)
  • hadley (1)
  • dpprdan (1)
  • config-i1 (1)
Top Labels
Issue Labels
feature (4) documentation (2) upkeep (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 829,796 last-month
  • Total docker downloads: 121,597,379
  • Total dependent packages: 199
    (may contain duplicates)
  • Total dependent repositories: 331
    (may contain duplicates)
  • Total versions: 12
  • Total maintainers: 1
cran.r-project.org: generics

Common S3 Generics not Provided by Base R Methods Related to Model Fitting

  • Versions: 7
  • Dependent Packages: 154
  • Dependent Repositories: 285
  • Downloads: 829,796 Last month
  • Docker Downloads: 121,597,379
Rankings
Downloads: 0.2%
Dependent packages count: 0.7%
Dependent repos count: 0.9%
Average: 5.1%
Forks count: 5.6%
Stargazers count: 5.9%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: r-generics
  • Versions: 5
  • Dependent Packages: 45
  • Dependent Repositories: 46
Rankings
Dependent packages count: 1.6%
Dependent repos count: 5.3%
Average: 21.7%
Stargazers count: 38.1%
Forks count: 41.8%
Last synced: 11 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 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
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.6 depends
  • methods * imports
  • covr * suggests
  • pkgload * suggests
  • testthat >= 3.0.0 suggests
  • tibble * suggests
  • withr * suggests
tests/testthat/testGenericsExtension/DESCRIPTION cran
  • generics * imports
tests/testthat/testMultiMethod/DESCRIPTION cran
tests/testthat/testMultiPackage/DESCRIPTION cran
tests/testthat/testS4Docs/DESCRIPTION cran
tests/testthat/testSameRd/DESCRIPTION cran
tests/testthat/testSingleMethod/DESCRIPTION cran