Skip to content

afcharts

0.5.1Package record

Produce Charts Following UK Government Analysis Function Guidance

0packages depend
5.3Kdownloads / year
94.0%test coverage
13/13flavors OK

Overview

About
Maintained by Olivia Box PowerCRAN page ↗GitHub ↗Website ↗Issues ↗Declared funder: Government Analysis Function

Colour palettes and a 'ggplot2' theme to follow the UK Government Analysis Function best practice guidance for producing data visualisations, available at https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/. Includes continuous and discrete colour and fill scales, as well as a 'ggplot2' theme.

Changes in 0.5.1
  • Updated the sequential colour palette to add two new shades (darkest-blue and lightest-blue). This means that the sequential palette can now be used to represent five categories, such as deprivation quintiles.
  • Renamed na_colour argument of scale_colour_continuous_af and scale_fill_continuous_af to na.value. This was necessary to enable use_afcharts to work with ggplot2 v4.0.1. Added na.value argument to scale_colour_discrete_af and scale_fill_discrete_af.
  • use_afcharts gains a reset argument to turn off analysis function styling of charts.
  • theme_af now uses theme options set by earlier calls of use_afcharts by default. #51
  • Set the main colour palettes to categorical. The Scale_*_discrete_af functions now use the 6 colour cateogrical palette by default, rather than the 4 colour.
  • Added af_dark_blue, af_orange and af_grey to give easier access to the hex codes of these colours.
  • Added arguments axis_text and axis_title to function theme_af to set

whether to show axis titles and labels.

  • Added argument legend_title to function theme_af to set whether to show

legend titles.

  • The legend argument of theme_af now accepts a legend justification e.g. 'top-right', 'left-centre' #47

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 30.0 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.5.1
READMEYes · 411 wordsVignettesYes · 4 · dynamicNEWSYes · 100% structured · mentions 0.5.1Citation fileNoWebsiteYes · pkgdown
Help pages
12 (1 internal)includes a package overview page
Examples that run
100%9 run in a plain check
Exported functions with examples
100%
Documented parameters
93%
Return-value docs
100%
Help pages citing references
0%

Downloads

5.3K
CRAN downloads in the past year
Rank #5,683 · ~14/day · ~440/mo
Daily download trend is not available in this view yet.
57030 days
1.5K90 days
5.3K1 year
Compare downloads with other packages →
Also on129 r2u27 autocran

Repository

30Stars
5Forks
9Open issues
3Open PRs
3Releases
403Commits
13Commit identities
403 commits · Last activity 2026-05-05 · +7.1% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
88%
Median days to close, 50 most recently updated closed issues
36
Median days to close, 50 most recently updated closed PRs
7

Stars over time

2025-10-02 · 252026-10-16 · 30
PracticesBeta

15 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/best-practice-and-impact/afcharts on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Code of conductContributing guideSupport guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-05-05 · The repository has a site deploy workflow

pkgdown site last built 2026-05-05

Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (3)
lintrLint workflowRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
22 external dependencies (excludes base and recommended)

Installing afcharts adds 26 packages (13 with compiled code, 16 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, farver 1.2 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (4)
Maintainer since 0.4.0 (2024), Contributor
Copyright holder
Releases (3)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.5.1Latest
    record
    2026-02-26 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 0.4.1
    record
    2025-01-13 · diff ↗
  • 0.4.0
    record
    2024-11-06
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2024-11-06
Total releases
3 / 2 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Bundled data
1.1 KB / 6 files
Download size
1.4 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("afcharts")
Box Power, O., Crown Copyright, Government Analysis Function, & Hannah, A. (2026). afcharts: Produce Charts Following UK Government Analysis Function Guidance (Version 0.5.1) [Computer software]. https://doi.org/10.32614/CRAN.package.afcharts

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for afcharts version 0.5.1 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy