Skip to content

Commit

Permalink
phs rebrand
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhannah95 committed Jan 16, 2020
1 parent 14ac92f commit dd342b2
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^phimethods\.Rproj$
^phsmethods\.Rproj$
^\.Rproj\.user$
^codecov\.yml$
^\.travis\.yml$
Expand Down
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: phimethods
Title: Standard Methods for use in PHI
Package: phsmethods
Title: Standard Methods for use in NHS Public Health Scotland
Version: 0.0.0.9000
Authors@R: c(
person("Jack", "Hannah", email = "[email protected]", role = c("aut", "cre")),
Expand All @@ -8,10 +8,10 @@ Authors@R: c(
person("Tina", "Fu", email = "[email protected]", role = "aut"),
person("Ciara", "Gribben", email = "[email protected]", role = "aut")
)
Description: Bespoke functions for commonly undertaken tasks by analysts in PHI.
Description: Bespoke functions for commonly undertaken analytical tasks in NHS Public Health Scotland.
License: GPL (>= 2)
URL: https://github.com/Health-SocialCare-Scotland/phimethods
BugReports: https://github.com/Health-SocialCare-Scotland/phimethods/issues
URL: https://github.com/Health-SocialCare-Scotland/phsmethods
BugReports: https://github.com/Health-SocialCare-Scotland/phsmethods/issues
Imports:
dplyr,
gdata,
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# phimethods 0.1.0
# phsmethods 0.1.0

- Initial package release
- `file_size`, `fin_year`, `postcode`, `qtr`, `qtr_end`, `qtr_next` and `qtr_prev` functions added
2 changes: 1 addition & 1 deletion R/file_size.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' Files with extensions not contained within this list will have their size
#' returned with no prefix. To request that a certain extension be explicitly
#' catered for, please create an issue on
#' \href{https://github.com/Health-SocialCare-Scotland/phimethods/issues}{GitHub}.
#' \href{https://github.com/Health-SocialCare-Scotland/phsmethods/issues}{GitHub}.
#'
#' File sizes are returned as the appropriate multiple of the unit byte
#' (bytes (B), kilobytes (KB), megabytes (MB), etc.). Each multiple is taken to
Expand Down
4 changes: 2 additions & 2 deletions R/fin_year.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' @title Assign a date to a financial year
#'
#' @description \code{fin_year} takes a date and assigns it to the correct
#' financial year in the PHI specified format.
#' financial year in the PHS specified format.
#'
#' @details The PHI accepted format for financial year is yyyy/yy e.g. 2017/18.
#' @details The PHS accepted format for financial year is yyyy/yy e.g. 2017/18.
#'
#' @param date A date which must be supplied with \code{Date} class. The
#' functions as.Date() or lubridate::dmy() are examples of functions that can
Expand Down
8 changes: 4 additions & 4 deletions R/phimethods.R → R/phsmethods.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' \code{phimethods} package
#' \code{phsmethods} package
#'
#' Standard Methods for use in PHI.
#' Standard Methods for use in PHS.
#'
#' See the README on \href{https://github.com/Health-SocialCare-Scotland/phimethods#readme}{GitHub}.
#' See the README on \href{https://github.com/Health-SocialCare-Scotland/phsmethods#readme}{GitHub}.
#'
#' @docType package
#' @name phimethods
#' @name phsmethods
#' @importFrom magrittr %>%
NULL

Expand Down
38 changes: 19 additions & 19 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,46 @@ knitr::opts_chunk$set(
)
```

# phimethods
# phsmethods

[![Build Status](https://travis-ci.com/Health-SocialCare-Scotland/phimethods.svg?branch=master)](https://travis-ci.com/Health-SocialCare-Scotland/phimethods)
[![codecov](https://codecov.io/gh/Health-SocialCare-Scotland/phimethods/branch/master/graph/badge.svg)](https://codecov.io/gh/Health-SocialCare-Scotland/phimethods)
[![Build Status](https://travis-ci.com/Health-SocialCare-Scotland/phsmethods.svg?branch=master)](https://travis-ci.com/Health-SocialCare-Scotland/phsmethods)
[![codecov](https://codecov.io/gh/Health-SocialCare-Scotland/phsmethods/branch/master/graph/badge.svg)](https://codecov.io/gh/Health-SocialCare-Scotland/phsmethods)

`phimethods` contains functions for commonly undertaken tasks by [PHI](https://nhsnss.org/how-nss-works/our-structure/public-health-and-intelligence/) analysts:
`phsmethods` contains functions for commonly undertaken analytical tasks in [NHS Public Health Scotland](https://publichealthreform.scot/public-health-scotland):

- `file_size()` returns the names and sizes of files in a directory
- `fin_year()` assigns a date to a financial year in the format `YYYY/YY`
- `postcode()` formats improperly recorded postcodes
- `qtr()`, `qtr_end()`, `qtr_next()` and `qtr_prev()` assign a date to a quarter

`phimethods` can be used on both the [server](http://spsssrv02.csa.scot.nhs.uk:8787/) and desktop versions of RStudio.
`phsmethods` can be used on both the [server](http://spsssrv02.csa.scot.nhs.uk:8787/) and desktop versions of RStudio.

## Installation

To install `phimethods`, the package `remotes` is required, and can be installed with `install.packages("remotes")`.
To install `phsmethods`, the package `remotes` is required, and can be installed with `install.packages("remotes")`.

You can then install `phimethods` on RStudio server from GitHub with:
You can then install `phsmethods` on RStudio server from GitHub with:

```{r gh-installation, eval = FALSE}
remotes::install_github("Health-SocialCare-Scotland/phimethods")
remotes::install_github("Health-SocialCare-Scotland/phsmethods")
```

Network security settings may prevent `remotes::install_github()` from working on RStudio desktop. If this is the case, `phimethods` can be installed by downloading the [zip of the repository](https://github.com/Health-SocialCare-Scotland/phimethods/archive/master.zip) and running the following code (replacing the section marked `<>`, including the arrows themselves):
Network security settings may prevent `remotes::install_github()` from working on RStudio desktop. If this is the case, `phsmethods` can be installed by downloading the [zip of the repository](https://github.com/Health-SocialCare-Scotland/phsmethods/archive/master.zip) and running the following code (replacing the section marked `<>`, including the arrows themselves):

```{r source-installation, eval = FALSE}
remotes::install_local("<FILEPATH OF ZIPPED FILE>/phimethods-master.zip",
remotes::install_local("<FILEPATH OF ZIPPED FILE>/phsmethods-master.zip",
upgrade = "never")
```

## Using phimethods

Load `phimethods` using `library()`:
Load `phsmethods` using `library()`:

```{r load}
library(phimethods)
library(phsmethods)
```

To access the help file for any of `phimethods`' functions, type `?function_name` into the RStudio console after loading the package:
To access the help file for any of `phsmethods`' functions, type `?function_name` into the RStudio console after loading the package:

```{r help, eval = FALSE}
?fin_year
Expand Down Expand Up @@ -118,17 +118,17 @@ qtr_prev(c)
qtr_prev(c, format = "short")
```

## Contributing to phimethods
## Contributing to phsmethods

At present, the maintainers of this package are [Jack Hannah](https://github.com/jackhannah95), [David Caldwell](https://github.com/davidc92) and [Lucinda Lawrie](https://github.com/lucindalawrie).

This package is intended to be in continuous development and contributions may be made by anyone within PHI. If you would like to contribute a function, or propose an improvement to an existing function, please first create an [issue](https://github.com/Health-SocialCare-Scotland/phimethods/issues) on GitHub and assign **all** of the package maintainers to it. This is to ensure that no duplication of effort occurs in the case of multiple people having the same idea. The package maintainers will discuss the issue and get back to you as soon as possible.
This package is intended to be in continuous development and contributions may be made by anyone within PHS. If you would like to contribute a function, or propose an improvement to an existing function, please first create an [issue](https://github.com/Health-SocialCare-Scotland/phsmethods/issues) on GitHub and assign **all** of the package maintainers to it. This is to ensure that no duplication of effort occurs in the case of multiple people having the same idea. The package maintainers will discuss the issue and get back to you as soon as possible.

When contributing, please create a [branch](https://github.com/Health-SocialCare-Scotland/phimethods/branches) in this repository and carry out all work on it. Please ensure you have linked RStudio to your GitHub account using `usethis::edit_git_config()` prior to making your contribution. When you are ready for a review, please create a [pull request](https://github.com/Health-SocialCare-Scotland/phimethods/pulls) and assign **all** of the package maintainers as reviewers. One or more of them will conduct a review, provide feedback and, if necessary, request changes prior to merging your branch.
When contributing, please create a [branch](https://github.com/Health-SocialCare-Scotland/phsmethods/branches) in this repository and carry out all work on it. Please ensure you have linked RStudio to your GitHub account using `usethis::edit_git_config()` prior to making your contribution. When you are ready for a review, please create a [pull request](https://github.com/Health-SocialCare-Scotland/phsmethods/pulls) and assign **all** of the package maintainers as reviewers. One or more of them will conduct a review, provide feedback and, if necessary, request changes prior to merging your branch.

Please be mindful of information governance when contributing to this package. No data files (aside from publically available and downloadable datasets or unless explicitly approved), server connection details, passwords or person identifiable or otherwise confidential information should be included anywhere within this package or any other repository (whether public or private) used within PHI. This includes within code and code commentary. For more information on security when using git and GitHub, and on using git and GitHub for version control more generally, please see the [Transforming Publishing Programme](https://www.isdscotland.org/Products-and-Services/Transforming-Publishing-Programme/)'s [Git guide](https://nhs-nss-transforming-publications.github.io/git-guide/) and [GitHub guidance](https://github.com/NHS-NSS-transforming-publications/GitHub-guidance).
Please be mindful of information governance when contributing to this package. No data files (aside from publically available and downloadable datasets or unless explicitly approved), server connection details, passwords or person identifiable or otherwise confidential information should be included anywhere within this package or any other repository (whether public or private) used within PHS. This includes within code and code commentary. For more information on security when using git and GitHub, and on using git and GitHub for version control more generally, please see the [Transforming Publishing Programme](https://www.isdscotland.org/Products-and-Services/Transforming-Publishing-Programme/)'s [Git guide](https://nhs-nss-transforming-publications.github.io/git-guide/) and [GitHub guidance](https://github.com/NHS-NSS-transforming-publications/GitHub-guidance).

`phimethods` will, as much as possible, adhere to the [tidyverse style guide](https://style.tidyverse.org/) and the [rOpenSci package development guide](https://devguide.ropensci.org/). The most pertinent points to take from these are:
`phsmethods` will, as much as possible, adhere to the [tidyverse style 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
Expand All @@ -138,6 +138,6 @@ Please be mindful of information governance when contributing to this package. N
- 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 `phimethods`; as long as you can write an R function, the package maintainers can assist with error handling, writing documentation, testing and other aspects of package development. It is advised, however, to consult Hadley Wickham's [R Packages](https://r-pkgs.org/) book prior to making a contribution. It may also be useful to consult the [documentation](https://github.com/Health-SocialCare-Scotland/phimethods/tree/master/R) and [tests](https://github.com/Health-SocialCare-Scotland/phimethods/tree/master/tests/testthat) of existing functions within this package as a point of reference.
It's not necessary to have experience with GitHub or of building an R package to contribute to `phsmethods`; as long as you can write an R function, the package maintainers can assist with error handling, writing documentation, testing and other aspects of package development. It is advised, however, to consult Hadley Wickham's [R Packages](https://r-pkgs.org/) book prior to making a contribution. It may also be useful to consult the [documentation](https://github.com/Health-SocialCare-Scotland/phsmethods/tree/master/R) and [tests](https://github.com/Health-SocialCare-Scotland/phsmethods/tree/master/tests/testthat) of existing functions within this package as a point of reference.

Please note that this README may fail to Knit on RStudio desktop as a result of network security settings. This is due to the badges for continuous integration and test coverage at the top of the document. If you are editing the README file, please Knit the `README.Rmd` document via RStudio server, or contact the package maintainers for assistance.
2 changes: 1 addition & 1 deletion man/file_size.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/fin_year.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions man/phimethods.Rd

This file was deleted.

13 changes: 13 additions & 0 deletions man/phsmethods.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(testthat)
library(phimethods)
library(phsmethods)

test_check("phimethods")
test_check("phsmethods")
2 changes: 1 addition & 1 deletion tests/testthat/test-fin_year.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_that("Date is accepted in various formats", {
expect_equal(fin_year(as.Date("17111993", "%d%m%Y")), "1993/94")
expect_equal(fin_year(as.Date("19980404", "%Y%m%d")), "1998/99")
expect_equal(fin_year(as.Date("21-Jan-2017", "%d-%B-%Y")), "2016/17")
expect_equal(fin_year(lubridate::dmy("29102019")), "2019/20")
expect_equal(fin_year(lubridate::dmy(29102019)), "2019/20")
})

test_that("Non-date formats produce an error", {
Expand Down

0 comments on commit dd342b2

Please sign in to comment.