Rescales data so it can be plotted on a spine chart
spine_rescaler(
data,
area_code,
indicator,
significance,
polarity,
area_type,
value,
timeperiod,
local_area_code,
median_line_area_code,
comparator_area_code = NA,
percent_display,
dps = 1
)
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)
unquoted field name where area codes are stored (local_area_code, median_line_area_code and comparator_area_code, if using, should all exist in this field)
unquoted field name of the field containing the indicator labels. Take care as errors will occur where indicator labels are the same but data exist for multiple sub-categories (for example, sex or age)
unquoted field name describing the statistical significance for that indicator (eg, Better, Worse, Similar etc)
unquoted field name containing the polarity information (currently only handles polarity returned by fingertipsR package)
unquoted field name containing area type information. This ensures the vertabra are only plotted for the same area types as the local_area area type (eg, when plotting a spine chart for County & UA areas, regions and national area types will be removed)
unquoted field name containing the values to be plotted
unquoted field name of the time period field
string; the code of the area that the spine chart is being drawn for
string; area code for the median line. Defaults to "E92000001" (England)
string; area code for the comparator point. Defaults to NA
number between 0 and 1; the percentage of values that needs to exist for a spine to display. Default is 0.25
number; number of decimal places to be displayed in the data table. The default is 1. Set to NA if this should be the same as the input data
A list containing "bars" and "points" which contains data that can be passed to the phe_spine_chart function