/dhmisc

Primary LanguageR

dhmisc

CRAN status Lifecycle: experimental

dhmisc is a collection of functions/tools I like to use but are either not present in any R packages I know of or their implementation in existing R packages don’t fulfill my needs.

Installation

Development version:

install.packages("dhmisc", repos = "https://dhersz.r-universe.dev")

# or
# install.packages("remotes")
remotes::install_github("dhersz/dhmisc")

Utilities

Functions

  • bump_pkg_version()
    Automatically bumps package version (either the major, minor, patch or dev component) and conditionally updates package metadata. Helper around desc::desc_bump_version() and codemetar::write_codemeta().

  • brazil_rapid_transit()
    Downloads Brazil’s rapid transit corridors and stops made available by ITDP Brasil at Mobilidados.

Pre-commit hooks

To use pre-commit hooks in R packages please see {precommit} R package installation and usage instructions. To use the hooks made available here you will need to run precommit::use_precommit() and configure .pre-commit-config.yaml as shown below (please remove any hooks you don’t want to use from the list):

repos:
-   repo: https://github.com/dhersz/dhmisc
    rev: v0.0.0.9014
    hooks:
    -   id: mod-codemeta-description-updated
    -   id: mod-readme-rmd-rendered
    -   id: version-bumped
  • mod-codemeta-description-updated and mod-readme-rmd-rendered
    Copies of codemeta-description-updated and readme-rmd-rendered, available in {precommit}, with adapted shebang to work on my computer.

  • version-bumped
    Checks if the package version has been bumped from last commit and if both DESCRIPTION and codemeta.json are staged for commit.

Acknowledgement

Credits for mod-codemeta-description-updated and mod-readme-rmd-rendered pre-commit hooks go to Lorenz Walthert, {precommit} maintainer.