ezrsurvey_options

ezrsurvey_options(**options)

Get or set ezrsurvey defaults.

ezrsurvey reads a handful of defaults from its session options, so you can tune behaviour once instead of repeating arguments. Call with no arguments to see the current effective values; call with name=value pairs to set them for the session. Persist them across sessions with a YAML profile (see use_ezrsurvey_profile()).

Recognised options:

  • pct_axis_unit: rounding step for percentage y-axes (default 25).
  • pct_axis_max: fixed percentage y-axis maximum, e.g. 100; None (default) means dynamic via nice_max().
  • bar_cols_max_items, bar_cols_max_label: thresholds that switch plot_bars() (orientation="auto") from vertical columns to horizontal bars: more than bar_cols_max_items bars (6) or any label longer than bar_cols_max_label characters (12).
  • bar_wrap_cols, bar_wrap_bars: wrap widths used by plot_bars() for column (12) and bar (28) labels.
  • bar_label_size, bar_size_step, bar_size_min: data-label text sizing in plot_bars(): base size (3.5), reduction per item past the item threshold (0.15) and the floor (2.4).
  • bar_width, bar_ref_items: bar thickness. Bars are drawn at bar_width (0.66) of a category slot when a chart has bar_ref_items
    1. bars, and the fraction scales with the bar count so the drawn thickness stays the same on every chart.
  • age_breaks, age_labels: default bands used by recode_age().
  • na_answers: strings treated as non-answers by na_blank().
  • drop_answers: answer values dropped by the drop= argument of calc_percentage() and friends when drop is not given; None (default) means drop nothing. See drop_items().
  • generation_scheme: default scheme for recode_generation().
  • current_year: reference year for age-to-cohort conversion; None uses the system year.
  • default_by: default grouping column name(s) applied by calc_percentage() / calc_percentage_multi() when by is omitted.
  • brand_colors, brand_color_primary: organisation brand colours, usually set by use_brand().
  • brand_font_major, brand_font_minor: brand heading and body typefaces; brand_font_minor becomes the default base_family of theme_ezrsurvey() when the font is installed.
  • brand_fonts_enabled: set False to keep brand colours but ignore brand fonts (default True).
  • brand_template_pptx, brand_template_docx: paths to the brand PowerPoint / Word template used by report_new(), report_deck() and scaffold_report().
  • progress: whether the slow helpers report which item they are on. “auto” (default) reports in an interactive session and stays silent in scripts; True or False force it either way.
  • confirm: whether a call that picks its own variables shows the selection and waits for a yes before a long run. “auto” (default) asks in an interactive session and never in a script.
  • output_dir: folder that a bare output file name lands in, created on demand (default “ezrsurvey-outputs”). A path that names a directory (“./chart.png”, “charts/chart.png”, anything absolute) is written exactly where it says. Set to “.” to put bare names back in the working directory.

Options last for the session. Reading returns every recognised option’s current effective value; setting returns the previous values, so you can restore them. To make settings permanent, write them to a YAML profile, which is loaded automatically when ezrsurvey is imported.

Parameters

Name Type Description Default
**options Either nothing (to read all values) or option=value pairs to set. {}

Returns

Name Type Description
dict When reading, all current values. When setting, the previous values.

See Also

use_ezrsurvey_profile, load_ezrsurvey_profile, reset_ezrsurvey_options

Examples

>>> ezrsurvey_options()
>>> ezrsurvey_options(pct_axis_max=100)
>>> ezrsurvey_options()["pct_axis_max"]
>>> reset_ezrsurvey_options()