# NOT RUN {
## An example with differing decimal places for individual indicators
library(dplyr)
df <- create_test_data() %>%
mutate(Value = case_when(
grepl("2$|4$|6$", IndicatorName) ~ round(Value,1),
TRUE ~ round(Value, 0)))
full_p <- area_profiles(df,
value = Value,
count = Count,
area_code = AreaCode,
local_area_code = "AC122",
indicator = IndicatorName,
timeperiod = Timeperiod,
trend = Trend,
polarity = Polarity,
significance = Significance,
area_type = AreaType,
median_line_area_code = "C001",
comparator_area_code = "PAC12",
datatable = TRUE,
relative_domain_text_size = 0.75,
relative_text_size = 1.2,
bar_width = 0.68,
indicator_label_nudgex = -0.1,
show_dividers = "outer",
header_positions = c(-1, -0.7, -0.44, -0.35, -0.25,
-0.15, -0.05, 1.08),
dps = NA)
full_p
## An example with domains and non-default indicator ordering
df <- create_test_data()
label_order <- c(1, 2, 4, 3, 6, 5)
df <- df %>%
mutate(IndicatorName = factor(IndicatorName,
levels = paste("Indicator", label_order)))
p <- area_profiles(df,
value = Value,
count = Count,
area_code = AreaCode,
local_area_code = "AC122",
indicator = IndicatorName,
timeperiod = Timeperiod,
trend = Trend,
polarity = Polarity,
significance = Significance,
area_type = AreaType,
median_line_area_code = "C001",
comparator_area_code = "PAC12",
datatable = TRUE,
relative_domain_text_size = 0.75,
relative_text_size = 1.2,
bar_width = 0.68,
indicator_label_nudgex = -0.1,
show_dividers = "outer",
header_positions = c(-1, -0.7, -0.53, -0.35, -0.25,
-0.15, -0.05, 1.05),
domain = Domain
)
p
# }
Run the code above in your browser using DataLab