Introducing Badgecreatr, a package that places badges in your readme

[This article was first published on Clean Code, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Introducing Badgecreatr, a package to create and place badges in your readme.Rmd file on Github.

Badgecreatr will create the following badges (aka shields):

Project Status: Active ? The project has reached a stable, usable state and is being actively developed. Licence Build Status codecov minimal R version CRAN_Status_Badge packageversion Last-changedate

Installation

Install the package with install.packages("badgecreatr")

How do you use badgecreatr?

Badgecreatr has one main function: badgeplacer().

The most simple command is:

badgecreatr::badgeplacer( githubaccount = "yourgithubname",githubrepo = "yourpackagename", branch = "master")

If your project is in its infancy and you don’t want people to use it yet:

badgecreatr::badgeplacer(status = "wip" , githubaccount = "yourgithubname",githubrepo = "yourpackagename") which will give it the status ‘Work in Progress’.

Repostatus gives you seven project statuses; Concept, WIP, Suspended, Abandoned, Active, Inactive, and Unsupported.

Why would you use this package?

When you have started yet another Github based r-package, copied the travis file and created a readme.Rmd file and you want to add these badges. Frankly I was a bit annoyed to copy almost identical markdown to new projects, it seemed right for automation.

Why would I not use this package?

  • you don’t create a r-package
  • you don’t want to create badges
  • you don’t use Github

What does badgecreatr do?

Badgecreatr reads your readme.Rmd file, reads your DESCRIPTION file and searches for a .travis.yml file.

Within the DESCRIPTION file badgecreatr will find: – package name – the version number of your package – the license : GPL-3, GPL-2, MIT, or CC0 – Minimal R version

Badgecreatr will create

  • repostatus badge (by default it will give you an active status)
  • a licence badge
  • If it finds a .travis.yml file:a Travis-CI Build-Status Badge
  • If it finds a codecov reference in the .travis.yml file, a Codecov Coverage Status Badge
  • a badge to indicate the version of R you are using
  • a CRAN status badge (will say ‘not published’ if your package is not on CRAN)
  • a package version badge
  • a last change badge

If you created badges in your readme before, badgecreatr will skip that badge.

Enjoy. – Roel

Notes:

  • The badges for R version, package version and last change are my invention.
  • The last change badge will update every time you re-knit your readme.md file
  • If you have suggestions or improvement open an issue or submit a pull request.

Further reading

Introducing Badgecreatr, a package that places badges in your readme was originally published by at Clean Code on July 08, 2016.

To leave a comment for the author, please follow the link and comment on their blog: Clean Code.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)