ezrsurvey reads a handful of defaults from R options (prefixed ezrsurvey.),
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()).
Value
When reading, a named list of all current values. When setting, the previous values, invisibly.
Details
Recognised options:
pct_axis_unitRounding step for percentage y-axes (default
25).pct_axis_maxFixed percentage y-axis maximum, e.g.
100;NULL(default) means dynamic vianice_max().bar_cols_max_items,bar_cols_max_labelThresholds that switch
plot_bars()(orientation = "auto") from vertical columns to horizontal bars: more thanbar_cols_max_itemsbars (6) or any label longer thanbar_cols_max_labelcharacters (12).bar_wrap_cols,bar_wrap_barsstringr::str_wrap()widths used byplot_bars()for column (12) and bar (28) labels.bar_label_size,bar_size_step,bar_size_minData-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_itemsBar thickness. Bars are drawn at
bar_width(0.66) of a category slot when a chart hasbar_ref_items(6) bars, and the fraction scales with the bar count so the drawn thickness stays the same on every chart. Raisebar_ref_itemsfor thinner bars throughout, lower it for chunkier ones.age_breaks,age_labelsDefault bands used by
recode_age().na_answersStrings treated as non-answers by
na_blank().drop_answersAnswer values dropped by the
drop =argument ofcalc_percentage()and friends whendropis not given;NULL(default) means drop nothing. Seedrop_items().generation_schemeDefault scheme for
recode_generation().current_yearReference year for age-to-cohort conversion;
NULLuses the system year.default_byDefault grouping column name(s) applied by
calc_percentage()/calc_percentage_multi()whenbyis omitted;NULL(default) means no default grouping.brand_colors,brand_color_primaryOrganisation brand colours: a vector of accent hexes and the primary accent used as the default single-series fill. Usually set by
use_brand(), but can be set by hand or in a profile.NULL(default) keeps the neutral ezrsurvey look.brand_font_major,brand_font_minorBrand heading and body typefaces.
brand_font_minorbecomes the defaultbase_familyoftheme_ezrsurvey()when the font is installed on this machine.brand_fonts_enabledSet
FALSEto keep brand colours but ignore brand fonts (defaultTRUE).brand_template_pptx,brand_template_docxPaths to the brand PowerPoint / Word template used as the default reference document by
report_new(),report_deck()andscaffold_report(). These are machine-specific absolute paths – if you persist them, prefer the project-level.ezrsurvey.ymlprofile over the user-level one.progressWhether the slow helpers report which item they are on.
"auto"(default) reports in an interactive session and stays silent in scripts, vignettes andR CMD check;TRUEorFALSEforce it either way. Seecrosstab_banner().confirmWhether 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 asks in a script;TRUEorFALSEforce it either way. Seecrosstab_banner().output_dirFolder that a bare output file name lands in, created on demand (default
"ezrsurvey-outputs", relative to the working directory).save_plot("chart.png")writesezrsurvey-outputs/chart.png, so a script's results collect in one place. 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 are ordinary R options under the ezrsurvey. prefix, so anything you
can do with options() works here too, and a setting lasts for the session.
Reading (ezrsurvey_options() with no arguments) returns every recognised
option's current effective value; setting returns the previous values
invisibly, so you can restore them. To make settings permanent, write them to
a YAML profile – edit it with edit_ezrsurvey_profile() or dump the current
session with save_ezrsurvey_profile() – which is loaded automatically at
package start-up.
See also
use_ezrsurvey_profile(), load_ezrsurvey_profile(),
reset_ezrsurvey_options().
Other config:
apply_order(),
edit_ezrsurvey_profile(),
ezrsurvey_profile_paths(),
get_dataset(),
get_order(),
list_orders(),
load_ezrsurvey_profile(),
order_for(),
register_order(),
register_order_presets(),
remove_order(),
reset_ezrsurvey_options(),
save_ezrsurvey_profile(),
use_dataset(),
use_ezrsurvey_profile()
Examples
ezrsurvey_options() # view all defaults
#> $pct_axis_unit
#> [1] 25
#>
#> $pct_axis_max
#> NULL
#>
#> $bar_cols_max_items
#> [1] 6
#>
#> $bar_cols_max_label
#> [1] 12
#>
#> $bar_wrap_cols
#> [1] 12
#>
#> $bar_wrap_bars
#> [1] 28
#>
#> $bar_label_size
#> [1] 3.5
#>
#> $bar_size_step
#> [1] 0.15
#>
#> $bar_size_min
#> [1] 2.4
#>
#> $bar_width
#> [1] 0.66
#>
#> $bar_ref_items
#> [1] 6
#>
#> $age_breaks
#> [1] 0 18 22 26 30 35 Inf
#>
#> $age_labels
#> [1] "17 or younger" "18 to 21" "22 to 25" "26 to 29"
#> [5] "30 to 34" "35+"
#>
#> $na_answers
#> [1] "Prefer not to answer"
#>
#> $drop_answers
#> NULL
#>
#> $generation_scheme
#> [1] "pew"
#>
#> $current_year
#> NULL
#>
#> $default_by
#> NULL
#>
#> $brand_colors
#> NULL
#>
#> $brand_color_primary
#> NULL
#>
#> $brand_font_major
#> NULL
#>
#> $brand_font_minor
#> NULL
#>
#> $brand_fonts_enabled
#> [1] TRUE
#>
#> $brand_template_pptx
#> NULL
#>
#> $brand_template_docx
#> NULL
#>
#> $progress
#> [1] "auto"
#>
#> $confirm
#> [1] "auto"
#>
#> $output_dir
#> [1] "ezrsurvey-outputs"
#>
ezrsurvey_options(pct_axis_max = 100)
ezrsurvey_options()$pct_axis_max # 100
#> [1] 100
reset_ezrsurvey_options() # back to defaults
