Skip to contents

[Stable]

[Stable]

Usage

csv_dataset_connector(
  dataname,
  file,
  keys = character(0),
  label = character(0),
  code = character(0),
  script = character(0),
  metadata = list(type = "csv", file = file),
  ...
)

csv_cdisc_dataset_connector(
  dataname,
  file,
  keys = get_cdisc_keys(dataname),
  parent = if (identical(dataname, "ADSL")) character(0L) else "ADSL",
  label = character(0),
  code = character(0),
  script = character(0),
  metadata = list(type = "csv", file = file),
  ...
)

Arguments

dataname

(character)
A given name for the dataset it may not contain spaces

file

(character)
path to (.csv) (or general delimited) file that contains data.frame object

keys

optional, (character)
vector of dataset primary keys column names

label

(character)
Label to describe the dataset.

code

(character)
A character string defining code to modify raw_data from this dataset. To modify current dataset code should contain at least one assignment to object defined in dataname argument. For example if dataname = ADSL example code should contain ADSL <- <some R code>. Can't be used simultaneously with script

script

(character)
Alternatively to code - location of the file containing modification code. Can't be used simultaneously with script.

metadata

(named list, NULL or CallableFunction)
Field containing either the metadata about the dataset (each element of the list should be atomic and length one) or a CallableFuntion to pull the metadata from a connection. This should return a list or an object which can be converted to a list with as.list.

...

(optional)
additional arguments applied to pull function (readr::read_delim) by default delim = ",".

parent

(character, optional) parent dataset name

Details

Create a TealDatasetConnector from csv (or general delimited file).

Create a CDISCTealDatasetConnector from csv (or general delimited) file with keys and parent name assigned automatically by dataname.

Examples

if (FALSE) {
x <- csv_dataset_connector(
  dataname = "ADSL",
  file = "path/to/file.csv",
  delim = ",",
  col_types = quote(readr::cols(AGE = "i"))
)
x$get_code()
}