Skip to content

R package: generate best-practice stats spreadsheets for publication

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

best-practice-and-impact/aftables

Repository files navigation

{aftables}

CRAN status R-CMD-check

Purpose

An R package to help automatically create reproducible spreadsheets that adhere to the guidance on releasing statistics in spreadsheets from the UK government’s Analysis Function, with a focus on accessibility.

Visit the {aftables} website for documentation.

Accessibility

This package is not yet capable of creating perfectly accessible spreadsheets but will help with the bulk of the work needed. Users of this packages should refer back to the main spreadsheet guidance or the spreadsheet accessibility checklist after using it to make sure nothing has been missed. Please email [email protected] if you use the package so they can monitor use and the outputs produced.

Contribute

The package is under (opinionated) active development. Please see the NEWS file for the latest changes.

To contribute, please add an issue or a pull request after reading the code of conduct and contributing guidance.

Install

Install the package from GitHub using {remotes}.

install.packages("remotes")  # if not already installed

remotes::install_github(
  repo = "best-practice-and-impact/aftables",  # GitHub user/repository
  dependencies = TRUE,              # install required/suggested packages
  build_vignettes = TRUE            # generate vignette documentation
)

library(aftables)  # attach package

How to install a11ytables

The original name of the aftables package was a11ytables. The package was renamed to make it consistent the afcharts package. Some function names were updated when the package was renamed. If you need to install a11ytables for a legacy project, the following code can be used.

install.packages("remotes")  # if not already installed

remotes::install_github(
  repo = "best-practice-and-impact/aftables",  # GitHub user/repository
  ref = "v0.3.2", # this installs the final version of a11ytables. Change if you need an earlier version.
  dependencies = TRUE,              # install required/suggested packages
  build_vignettes = TRUE            # generate vignette documentation
)

library(a11ytables)  # attach package

Use

To create a spreadsheet:

  1. Use create_aftable()
  2. Pass the output to generate_workbook()
  3. Pass the output to openxlsx::saveWorkbook()

Run ?function_name or visit the package website for function documentation. For long-form documentation, visit the package website or run browseVignettes("aftables") to read the:

This package also includes an RStudio Addin that inserts pre-filled demo skeletons of the {aftables} workflow.

Related projects

The ONS’s Analysis Standards and Pipelines team has released a Python package called ‘gptables’. {aftables} is an independent effort that offers a native R solution that is very similar to gptables in its outputs, though there are some differences in implementation.

{aftables} can help you fulfill a Reproducible Analytical Pipeline by automating the generation of compliant spreadsheets for publication.

Code of Conduct

Please note that the {aftables} project is released with a Contributor Code of Conduct.

Copyright and Licensing

© Crown Copyright, 2023.

This work is Crown Copyright. The source code for the software is released under the MIT licence as per the the UK Government Licensing Framework and the GDS Way licensing guidance. The documentation for the software is released under the Open Government Licence.