Skip to contents

Load Datas

Usage

sbf_load_datas(
  sub = sbf_get_sub(),
  main = sbf_get_main(),
  rename = identity,
  env = parent.frame(),
  x_name = ".*"
)

Arguments

sub

A string or character vector specifying the path to the sub folder (by default the current sub folder).

main

A string specifying the path to the main folder (by default the current main folder)

rename

A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment.

env

The environment to load the objects into

x_name

A string of the Perl-compatible regular expression to match.

Value

An invisible character vector of the data frames' names.

Examples

if (FALSE) { # \dontrun{
sbf_set_main(file.path(tempdir(), "output"))
outing <- data.frame(x = 1)
capture <- data.frame(x = 2)
captures <- data.frame(x = 3)
sbf_save_datas()

# matches anywhere in the name
sbf_load_datas(x_name = "capture") # capture, captures

# ^ and $ match the whole name
sbf_load_datas(x_name = "^capture$") # capture
sbf_load_datas(x_name = "^(outing|capture)$") # capture, outing

# (?! ) excludes names
sbf_load_datas(x_name = "^(?!capture$)") # captures, outing

sbf_reset()
} # }