do_get: Wrapper function for importing and exporting

Description Usage Arguments

View source: R/do_get.R

Description

Wrapper that imports and exports result of a function to a file on disk.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
do_get(
  ...,
  do = TRUE,
  f = NULL,
  file = tempfile(),
  ext = "rds",
  dir = getwd(),
  path = NULL,
  f_import = rio::import,
  f_export = rio::export,
  append = FALSE,
  export = TRUE,
  overwrite = FALSE
)

Arguments

...

Extra arguments to pass to 'f'

do

Whether to actually do anything.

f

function to execute

file

File name (without extension) to generate 'path' if 'path' is not explicitly provided.

ext

File extension to use to generate 'path' if 'path' is not explicitly provided.

dir

Directory to use to generate 'path' if 'path' is not explicitly provided.

path

Path to export to.

f_import

Function to import with if file exists and 'overwrite = TRUE'.

f_export

Function to export with if 'export = TRUE' .

append

Whether to append. Supersedes 'export' and 'overwrite'.

export

Whether to export. Supersedes 'overwrite.

overwrite

Whether to overwrite.


tonyelhabr/xgbh documentation built on Dec. 23, 2021, 11:59 a.m.