Skip to contents

Set global options used by all downstream functions (edstr_import(), edstr_clean(), edstr_extract(), edstr_view()). Creates the output directory if it does not exist. edstr_dirname and edstr_filename support glue syntax (e.g. "{Sys.Date()}").

Usage

edstr_config(
  edstr_dirname,
  edstr_filename,
  edstr_text = NULL,
  edstr_overwrite = NULL,
  edstr_connect_dir = NULL,
  ...
)

Arguments

edstr_dirname

<character(1)> Path to the output directory. Created via fs::dir_create() if it does not exist.

edstr_filename

<character(1)> Prefix used to name output files (e.g. "my_study" produces my_study_import.parquet and my_study_clean.parquet; edstr_extract() writes my_study_extract.xlsx, .json and .rds into an extract/ subdirectory). Supports glue syntax.

edstr_text

<character(1)> Name of the text column in the data. Supplies the default text argument of edstr_clean() and the default text_input argument of edstr_extract() and edstr_view().

edstr_overwrite

<logical(1)> Controls caching behaviour when an output file already exists:

  • TRUE: overwrite without prompting.

  • FALSE: load the cached file without prompting.

  • NULL (default): prompt the user interactively.

edstr_connect_dir

<character(1)> Path to the YAML connection file holding the driver, address and TNS entries edstr_import() reads. Supplies its default connect_dir argument. The file is read when edstr_import() runs, so it need not exist yet.

...

Additional options passed to options().

Value

Invisibly returns NULL. Called for its side effects (setting R options and printing a configuration summary).

Examples

edstr_config(
  edstr_dirname = tempdir(),
  edstr_filename = "my_study",
  edstr_text = "note_text",
  edstr_overwrite = TRUE
)
#> 
#> ── edstr_config ────────────────────────────────────────────────────────────────
#> 
#>  Root : /home/runner/work/edstr/edstr
#> 
#>  Files will be saved in /tmp/RtmpbqjexN with prefix my_study
#> 
#> ────────────────────────────────────────────────────────────────────────────────