Prepare saving location in get functions

file_prep(
  save_dir = NULL,
  name,
  out_type = ".parquet",
  sub_dir = NULL,
  create_dir = TRUE,
  ...
)

Arguments

save_dir

Character. Name of directory to save results into.

name

Character. Usually data_name from a data map (e.g. see envImport::data_map)

out_type

Character. File type to save (anything accepted by rio::export())

sub_dir

Character or NULL. Save to fs::path(save_dir, sub_dir)?

...

Not used

Value

Character. Name of file to save, usually within get_x functions.

Examples

file_prep(here::here(), name = "galah", create_dir = FALSE)
#> save_file will be H:/dev/nige/packages/envImport/galah/galah.parquet
#> H:/dev/nige/packages/envImport/galah/galah.parquet