# NOT RUN {
newSlide(
main_deck,
~ cyl + wt,
title = "Cyl and Weight",
subtitle = "2017 Data"
)
# Grouped bar plot
newSlide(
main_deck,
~ approval + age4,
title = "Approval by age group",
display_settings = list(
vizType = "groupedBarPlot",
showValueLabels = TRUE
),
subtitle = "2017 Data"
)
# Horizontal stacked bars
newSlide(
main_deck,
~ approval + age4,
title = "Approval by age group",
display_settings = list(
vizType = "horizontalStackedBarPlot"
),
subtitle = "2017 Data"
)
# A donut is only suitable for a single variable
newSlide(
main_deck,
~ approval,
title = "Approval of new feature",
display_settings = list(
vizType = "donut",
showValueLabels = FALSE
),
subtitle = "2017 Data"
)
# Can specify advanced options by specifying `analyses` directly
# `formulaToSlideQuery()` and `slideQueryEnv()` help describe the API
newSlide(
main_deck,
title = "custom slide",
analyses = list(list(
query = formulaToSlideQuery(~categories(fav_array)+subvariables(fav_array), ds),
query_environment = slideQueryEnv(filter = filters(ds)[[1]]),
display_settings = list(viz_type = list(value = "table")),
viz_specs = list(
default = list(
format = list(
decimal_places = list(percentages = 0L, other = 2L),
show_empty = FALSE
)
),
table = list(
measures = c("col_percent", "pairwise_t_test"),
page_layout = list(
rows = list(
top = list(),
bottom = c("base_unweighted", "scale_mean", "significant_columns")
),
measure_layout = "long"
),
pairwise_comparison = list(sig_threshold = c(0.05, 0.01)),
format = list(pval_colors = FALSE)
)
)
))
)
# }
Run the code above in your browser using DataLab