Produce Charts that you See on the Fingertips Website

Use Fingertips charts to recreate the visualisations that are displayed on the Fingertips website (< http://fingertips.phe.org.uk/>).


BuildStatus CoverageStatus

CRAN StatusBadge CRAN TotalDownloads CRAN MonthlyDownloads

This is an R package to help users to easily reproduce charts that are displayed on Public Health England’s Fingertips data tool. Along with the fingertipsR package, this package can be used to help users bring the data on the website into their own outputs.

Installation

CRAN

Get the latest released, stable version from CRAN:

install.packages("fingertipscharts")

With devtools

You can install the latest development version from github using devtools:

# install.packages("devtools")
devtools::install_github("PublicHealthEngland/fingertipscharts",
                         build_vignettes = TRUE)

From zip

Download this repository from GitHub and either build from source or do the following, that also requires devtools:

source <- devtools:::source_pkg("C:/path/to/fingertipscharts-master")
install(source)

Base R instructions

To install the package without the use of CRAN or devtools, download the .tar.gz file and then run:

install.packages(path_to_file, repos = NULL, type="source")

Where path_to_file would represent the full path and file name.

Example of some visualisations

Here are a couple of example visualisations the package provides. See the vignettes for a more comprehensive overview.

Trends

library(fingertipsR)
library(fingertipscharts)
library(dplyr)
df <- fingertips_data(90366) %>%
          filter(Sex == "Male")
p <- trends(df,
            timeperiod = Timeperiod,
            value = Value,
            area = AreaName,
            comparator = "England",
            area_name = "Cambridgeshire",
            fill = ComparedtoEnglandvalueorpercentiles,
            lowerci = LowerCI95.0limit,
            upperci = UpperCI95.0limit,
            title = "Life expectancy at birth",
            subtitle = "Cambridgeshire compared to England",
            xlab = "Year",
            ylab = "Age (years)")
p

Compare indicators

library(tidyr)
df <- fingertips_data(c(90362, 90366)) %>%
        group_by(IndicatorID) %>%
        filter(Timeperiod == "2014 - 16" &
                       Sex == "Male") %>%
        ungroup() %>%
        select(IndicatorID, AreaName, Value) %>%
        mutate(IndicatorID = paste0("x", IndicatorID)) %>%
        spread(IndicatorID, Value)
p <- compare_indicators(df,
                        x = x90362,
                        y = x90366,
                        xlab = "Healthy life expectancy at birth",
                        ylab = "Life expectancy at birth",
                        highlight_area = c("England", "Dorset"),
                        area = AreaName,
                        add_R2 = TRUE)
p

News

fingertipscharts 0.0.2

  • Added detail around the area_profiles() function
  • Added create_test_data()

fingertipscharts 0.0.1

Due to popular demand, fingertipscharts has been created to help users create the charts they see on Public Health England's Fingertips website. There is an accompanying vignette that shows users the potential of the functions browseVignettes("fingertipscharts")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("fingertipscharts")

0.0.3 by Sebastian Fox, a month ago


Report a bug at https://github.com/PublicHealthEngland/fingertipscharts/issues


Browse source code at https://github.com/cran/fingertipscharts


Authors: Sebastian Fox [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports dplyr, fingertipsR, geojsonio, ggplot2, leaflet, lemon, mapproj, purrr, rlang, scales, sf, stats, stringr, tibble, tidyr, utils

Suggests gdtools, knitr, rmarkdown, testthat, vdiffr


See at CRAN