embed_cat_freq_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

Create Word Report with Univariates for Categorical Columns Sharing Same Categories

Usage

embed_cat_freq_plot_docx(
  data,
  ...,
  inverse = FALSE,
  dep = tidyselect::everything(),
  indep = NULL,
  colour_palette = NULL,
  mesos_group = NULL,
  call = rlang::caller_env()
)

embed_cat_freq_plot_docx(
  data,
  ...,
  inverse = FALSE,
  dep = tidyselect::everything(),
  indep = NULL,
  colour_palette = NULL,
  mesos_group = NULL,
  call = rlang::caller_env()
)

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.

inverse

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

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.

call

Internal call

⁠obj:<call>⁠ // Default: rlang::caller_env() (optional)

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

Value

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

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_freq_plot_docx(dep = b_1:b_3,
              showNA = "never",
              descend = TRUE,
              return_raw = FALSE,
              hide_label_if_prop_below=0,
              data_label = "count",
              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"))
library(officer) # To save the rdocx object to disk

test_docx_b13 <-
   ex_survey |>
   embed_cat_freq_plot_docx(dep = b_1:b_3,
              showNA = "never",
              descend = TRUE,
              return_raw = FALSE,
              hide_label_if_prop_below=0,
              data_label = "count",
              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]