Skip to contents

edstr_config() sets global options that all downstream functions rely on. It must be called before any other edstr_* function.

Required arguments

Two arguments are mandatory: the output directory and the file name prefix.

edstr_config(
  edstr_dirname = "output/my_study",
  edstr_filename = "my_study"
)

The directory is created automatically if it does not exist. Output files are named {edstr_filename}_{step}.parquet for import and clean steps (e.g. my_study_import.parquet, my_study_clean.parquet). The extract step writes into an extract/ subdirectory instead, as {edstr_filename}_extract.xlsx, .json and .rds (e.g. output/my_study/extract/my_study_extract.rds).

Glue syntax

Both edstr_dirname and edstr_filename support glue expressions, which are evaluated at call time.

edstr_config(
  edstr_dirname = "output/{Sys.Date()}",
  edstr_filename = "study_{format(Sys.Date(), '%Y%m%d')}"
)

Text column

Setting edstr_text avoids repeating the column name in edstr_clean(), edstr_extract(), and edstr_view().

edstr_config(
  edstr_dirname = "output/my_study",
  edstr_filename = "my_study",
  edstr_text = "note_text"
)

If omitted, the text column must be passed explicitly to each function.

Caching behaviour

The edstr_overwrite option controls what happens when an output file already exists.

Value Behaviour
TRUE Overwrite without prompting
FALSE Load the cached file without prompting
NULL Prompt an interactive menu (load / overwrite / cancel)

NULL is the default, useful during interactive development. Set TRUE when re-running a full pipeline, FALSE when resuming work on a cached dataset.

edstr_config(
  edstr_dirname = "output/my_study",
  edstr_filename = "my_study",
  edstr_overwrite = TRUE
)

Connection file

Setting edstr_connect_dir avoids repeating the path to the YAML connection file edstr_import() reads.

edstr_config(
  edstr_dirname = "output/my_study",
  edstr_filename = "my_study",
  edstr_connect_dir = "config/connect.yml"
)

The file is only read when edstr_import() runs, so it need not exist at configuration time. If omitted, the path must be passed to edstr_import() as connect_dir.

Additional options

Extra named arguments are passed directly to options(), which can be useful for setting project-level options alongside edstr.

edstr_config(
  edstr_dirname = "output/my_study",
  edstr_filename = "my_study",
  dplyr.summarise.inform = FALSE
)