Package: phsmethods 1.2.0.9000

Tina Fu

phsmethods: Standard Methods for Use in Public Health Scotland

A collection of methods for commonly undertaken analytical tasks, primarily developed for Public Health Scotland (PHS) analysts, but the package is also generally useful to others working in the healthcare space, particularly since it has functions for working with Community Health Index (CHI) numbers. The package can help to make data manipulation and analysis more efficient and reproducible.

Authors:Public Health Scotland [cph], David Caldwell [aut], Lucinda Lawrie [rev], Jack Hannah [aut], Tina Fu [aut, cre], Ciara Gribben [aut], Chris Deans [aut], Jaime Villacampa [aut], Graeme Gowans [aut], Alice Byers [ctb], Alan Yeung [ctb], James Hayes [aut], Nicolaos Christofidis [aut]

phsmethods_1.2.0.9000.tar.gz
phsmethods_1.2.0.9000.zip(r-4.7-any)phsmethods_1.2.0.9000.zip(r-4.6-any)phsmethods_1.2.0.9000.zip(r-4.5-any)
phsmethods_1.2.0.9000.tgz(r-4.6-any)phsmethods_1.2.0.9000.tgz(r-4.5-any)
phsmethods_1.2.0.9000.tar.gz(r-4.7-any)phsmethods_1.2.0.9000.tar.gz(r-4.6-any)
phsmethods_1.2.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
phsmethods/json (API)

# Install 'phsmethods' in R:
install.packages('phsmethods', repos = c('https://public-health-scotland.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/public-health-scotland/phsmethods/issues

Pkgdown/docs site:https://code.publichealthscotland.scot

Datasets:
  • area_lookup - Codes and names of Scottish geographical and administrative areas.

On CRAN:

Conda:

9.16 score 59 stars 146 scripts 389 downloads 17 exports 35 dependencies

Last updated from:c1e6f658ef. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK144
source / vignettesOK205
linux-releaseOK140
macos-releaseOK136
macos-oldrelOK104
windows-develOK102
windows-releaseOK77
windows-oldrelOK87
wasm-releaseOK113

Exports:age_calculateage_from_chias_percentchi_checkchi_padcreate_age_groupsdob_from_chiextract_fin_yearfile_sizeformat_postcodematch_areaNA_percent_qtrqtr_endqtr_nextqtr_prevsex_from_chi

Dependencies:bitbit64clicliprcpp11crayondplyrfarvergenericsgluehmslabelinglifecyclelubridatemagrittrpillarpkgconfigprettyunitsprogressR6RColorBrewerreadrrlangscalesstringistringrtibbletidyselecttimechangetzdbutf8vctrsviridisLitevroomwithr

Working with CHI numbers
Checking and correcting CHI numbers | Cleaning up bad CHI numbers | Inferring data from a CHI number | The structure of a CHI number | Modulus-11 check | Changes to CHI numbers (August 2026): Inclusion of Modulus-10 check | Extracting sex from CHI | Extracting Date of Birth from CHI | Extracting age from CHI

Last update: 2026-08-10
Started: 2023-11-28

Using percent vectors
Motivation | Creating percentages | Rounding | Rounding via as_percent + digits | Rounding via round() | Math with percent vectors | percent vectors and tidyverse | vectors and formatted tables | percent vectors and ggplot2

Last update: 2026-02-05
Started: 2026-02-05