embed_cat_prop_plot_docx {saros}R Documentation

Create Word Report with Univariates for Categorical Columns Sharing Same Categories

Description

Create Word Report with Univariates for Categorical Columns Sharing Same Categories

Usage

embed_cat_prop_plot_docx(
  data,
  ...,
  dep = tidyselect::everything(),
  indep = NULL,
  colour_palette = NULL,
  mesos_group = NULL,
  plot_height = 15,
  inverse = FALSE
)

Arguments

data

Survey data

⁠obj:<data.frame>|obj:<tbl_df>⁠ // Required

A data frame (or a srvyr-object) with the columns specified in the chapter_overview 'dep_cat', etc columns.

...

Dynamic dots

<dynamic-dots>

Arguments forwarded to the corresponding functions that create the elements.

dep, indep

Variable selections

<tidyselect> // Default: NULL, meaning everything for dep, nothing for indep.

Columns in data. Currently allows tidyselect-syntax, which will be removed.

colour_palette

Character vector of colour codes.

mesos_group

Specific group to compare with

⁠scalar<character>⁠ // Default: NULL (optional)

Both the absolute and relative folderpaths are required, as strings.

plot_height

Fixed height of the plot in cm. Defaults to 15.

inverse

Flag, defaults to FALSE. If TRUE, swaps x-axis and faceting.

Value

rdocx object, which can be saved with print() after loading the officer-package

Examples

library(officer) # To save the rdocx object to disk

test_docx_b13 <-
   ex_survey |>
   embed_cat_prop_plot_docx(dep = b_1:b_3,
              showNA = "never",
              descend = TRUE,
              return_raw = FALSE,
              hide_label_if_prop_below=0,
              data_label = "percentage_bare",
              data_label_decimal_symbol = ",",
              digits = 1,
              label_font_size = 12,
              main_font_size = 12,
             plot_height_multiplier = .3,
             plot_height_fixed_constant = 1,
              vertical = FALSE,
              font_family = "sans")
print(test_docx_b13, target = tempfile(fileext = ".docx"))

[Package saros version 1.0.4 Index]