Skip to content

Commit

Permalink
Add a badge to indicate the CRAN version/status
Browse files Browse the repository at this point in the history
  • Loading branch information
Moohan committed Jan 10, 2024
1 parent c432ad5 commit ee6f367
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ knitr::opts_chunk$set(
```

# phsmethods

<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/phsmethods)](https://CRAN.R-project.org/package=phsmethods)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Public-Health-Scotland/phsmethods)](https://github.com/Public-Health-Scotland/phsmethods/releases/latest)
[![Build Status](https://github.com/Public-Health-Scotland/phsmethods/workflows/R-CMD-check/badge.svg)](https://github.com/Public-Health-Scotland/phsmethods/actions)
[![codecov](https://codecov.io/gh/Public-Health-Scotland/phsmethods/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Public-Health-Scotland/phsmethods)
<!-- badges: end -->

`phsmethods` contains functions for commonly undertaken analytical tasks in [Public Health Scotland (PHS)](https://www.publichealthscotland.scot/):

Expand Down
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,35 @@

# phsmethods

<!-- badges: start -->

[![CRAN
status](https://www.r-pkg.org/badges/version/phsmethods)](https://CRAN.R-project.org/package=phsmethods)
[![GitHub release (latest by
date)](https://img.shields.io/github/v/release/Public-Health-Scotland/phsmethods)](https://github.com/Public-Health-Scotland/phsmethods/releases/latest)
[![Build
Status](https://github.com/Public-Health-Scotland/phsmethods/workflows/R-CMD-check/badge.svg)](https://github.com/Public-Health-Scotland/phsmethods/actions)
[![codecov](https://codecov.io/gh/Public-Health-Scotland/phsmethods/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Public-Health-Scotland/phsmethods)
<!-- badges: end -->

`phsmethods` contains functions for commonly undertaken analytical tasks
in [Public Health Scotland
(PHS)](https://www.publichealthscotland.scot/):

- `create_age_groups()` categorises ages into groups
- `chi_check()` assesses the validity of a CHI number
- `chi_pad()` adds a leading zero to nine-digit CHI numbers
- `sex_from_chi()` extracts the sex of a person from a CHI number
- `file_size()` returns the names and sizes of files in a directory
- `extract_fin_year()` assigns a date to a financial year in the format
`YYYY/YY`
- `match_area()` converts geography codes into area names
- `format_postcode()` formats improperly recorded postcodes
- `qtr()`, `qtr_end()`, `qtr_next()` and `qtr_prev()` assign a date to a
quarter
- `age_calculate()` calculates age between two dates
- `dob_from_chi()` extracts Date of Birth (DoB) from the CHI number
- `age_from_chi()` extracts age from the CHI number
- `create_age_groups()` categorises ages into groups
- `chi_check()` assesses the validity of a CHI number
- `chi_pad()` adds a leading zero to nine-digit CHI numbers
- `sex_from_chi()` extracts the sex of a person from a CHI number
- `file_size()` returns the names and sizes of files in a directory
- `extract_fin_year()` assigns a date to a financial year in the
format `YYYY/YY`
- `match_area()` converts geography codes into area names
- `format_postcode()` formats improperly recorded postcodes
- `qtr()`, `qtr_end()`, `qtr_next()` and `qtr_prev()` assign a date to
a quarter
- `age_calculate()` calculates age between two dates
- `dob_from_chi()` extracts Date of Birth (DoB) from the CHI number
- `age_from_chi()` extracts age from the CHI number

`phsmethods` can be used on both the PHS server and desktop versions of
RStudio.
Expand Down Expand Up @@ -146,17 +151,17 @@ guide](https://style.tidyverse.org/) and the [rOpenSci package
development guide](https://devguide.ropensci.org/). The most pertinent
points to take from these are:

- All function names should be in lower case, with words separated by an
underscore
- Put a space after a comma, never before
- Put a space before and after infix operators such as `<-`, `==` and
`+`
- Limit code to 80 characters per line
- Function documentation should be generated using
[`roxygen2`](https://github.com/r-lib/roxygen2)
- All functions should be tested using
[`testthat`](https://github.com/r-lib/testthat)
- The package should always pass `devtools::check()`
- All function names should be in lower case, with words separated by
an underscore
- Put a space after a comma, never before
- Put a space before and after infix operators such as `<-`, `==` and
`+`
- Limit code to 80 characters per line
- Function documentation should be generated using
[`roxygen2`](https://github.com/r-lib/roxygen2)
- All functions should be tested using
[`testthat`](https://github.com/r-lib/testthat)
- The package should always pass `devtools::check()`

It’s not necessary to have experience with GitHub or of building an R
package to contribute to `phsmethods`. If you wish to contribute code
Expand Down

0 comments on commit ee6f367

Please sign in to comment.