Skip to content

Commit

Permalink
Merge branch 'main' into 712-tm_g_distribution@main
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo authored Apr 19, 2024
2 parents 2968059 + cbdc1ca commit 3c75011
Show file tree
Hide file tree
Showing 3 changed files with 403 additions and 167 deletions.
168 changes: 84 additions & 84 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,52 +56,49 @@
#' CO2 <- data.frame(CO2)
#' })
#' datanames(data) <- c("CO2")
#' join_keys(data) <- default_cdisc_join_keys[datanames(data)]
#'
#' app <- init(
#' data = data,
#' modules = modules(
#' tm_g_bivariate(
#' x = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "conc",
#' fixed = FALSE
#' )
#' ),
#' y = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "uptake",
#' multiple = FALSE,
#' fixed = FALSE
#' )
#' ),
#' row_facet = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "Type",
#' fixed = FALSE
#' )
#' ),
#' col_facet = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "Treatment",
#' fixed = FALSE
#' )
#' ),
#' ggplot2_args = ggplot2_args(
#' labs = list(subtitle = "Plot generated by Bivariate Module")
#' modules = tm_g_bivariate(
#' x = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "conc",
#' fixed = FALSE
#' )
#' ),
#' y = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "uptake",
#' multiple = FALSE,
#' fixed = FALSE
#' )
#' ),
#' row_facet = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "Type",
#' fixed = FALSE
#' )
#' ),
#' col_facet = data_extract_spec(
#' dataname = "CO2",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["CO2"]]),
#' selected = "Treatment",
#' fixed = FALSE
#' )
#' ),
#' ggplot2_args = ggplot2_args(
#' labs = list(subtitle = "Plot generated by Bivariate Module")
#' )
#' )
#' )
Expand All @@ -121,48 +118,46 @@
#'
#' app <- init(
#' data = data,
#' modules = modules(
#' tm_g_bivariate(
#' x = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "AGE",
#' fixed = FALSE
#' )
#' ),
#' y = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "SEX",
#' multiple = FALSE,
#' fixed = FALSE
#' )
#' ),
#' row_facet = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "ARM",
#' fixed = FALSE
#' )
#' ),
#' col_facet = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "COUNTRY",
#' fixed = FALSE
#' )
#' ),
#' ggplot2_args = ggplot2_args(
#' labs = list(subtitle = "Plot generated by Bivariate Module")
#' modules = tm_g_bivariate(
#' x = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "AGE",
#' fixed = FALSE
#' )
#' ),
#' y = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "SEX",
#' multiple = FALSE,
#' fixed = FALSE
#' )
#' ),
#' row_facet = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "ARM",
#' fixed = FALSE
#' )
#' ),
#' col_facet = data_extract_spec(
#' dataname = "ADSL",
#' select = select_spec(
#' label = "Select variable:",
#' choices = variable_choices(data[["ADSL"]]),
#' selected = "COUNTRY",
#' fixed = FALSE
#' )
#' ),
#' ggplot2_args = ggplot2_args(
#' labs = list(subtitle = "Plot generated by Bivariate Module")
#' )
#' )
#' )
Expand Down Expand Up @@ -666,7 +661,12 @@ srv_g_bivariate <- function(id,
expr = {
# Add facetting labels
# optional: grid.newpage() # nolint: commented_code.
p <- add_facet_labels(p, xfacet_label = nulled_col_facet_name, yfacet_label = nulled_row_facet_name)
# Prefixed with teal.modules.general as its usage will appear in "Show R code"
p <- teal.modules.general::add_facet_labels(
p,
xfacet_label = nulled_col_facet_name,
yfacet_label = nulled_row_facet_name
)
grid::grid.newpage()
grid::grid.draw(p)
},
Expand Down
161 changes: 78 additions & 83 deletions man/tm_g_bivariate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3c75011

Please sign in to comment.