spine_preprocess: Preprocess data for spine chart

Description Usage Arguments Details Value

View source: R/spine_chart_utils.R

Description

Returns a data frame with the latest time period of data for each indicator name.

Usage

1
spine_preprocess(data, indicator, timeperiod_sortable)

Arguments

data

a data frame to create the spine chart from. the data frame should contain data for all area types included in the chart (eg, if plotting for County & UA with a comparator of region and a median line for national, the data frame should contain all of these data)

indicator

unquoted field name for indicators. This should be what is presented as the label for the final spine chart, hence should be unique for each vertabra. Be careful the indicator doesn't have sub-categories based on other fields, such as sex (male, female, persons) or age group

timeperiod_sortable

unquoted field name containing the time period that is numeric and sortable, such that higher values are a later time period

Details

This processing only takes place on the indicator field and the time period field provided. If the data contains multiple sexes or age groups for an indicator, make sure the indicator field reflects this.

Value

A processed data frame for latest time periods of given indicators


fingertipscharts documentation built on July 2, 2020, 2:59 a.m.