Script TealDatasetConnector
script_dataset_connector.Rd
Usage
script_dataset_connector(
dataname,
file,
keys = character(0),
label = character(0),
code = character(0),
script = character(0),
metadata = NULL,
...
)
script_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 = NULL,
...
)
Arguments
- dataname
(
character
)
A given name for the dataset it may not contain spaces- file
(
character
)
file location containing code to be evaluated in connector. Object obtained in the last call from file will be returned to the connector - same assource(file = file)$value
- 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 modifyraw_data
from this dataset. To modify current dataset code should contain at least one assignment to object defined indataname
argument. For example ifdataname = ADSL
example code should containADSL <- <some R code>
. Can't be used simultaneously withscript
- script
(
character
)
Alternatively tocode
- location of the file containing modification code. Can't be used simultaneously withscript
.- metadata
(named
list
,NULL
orCallableFunction
)
Field containing either the metadata about the dataset (each element of the list should be atomic and length one) or aCallableFuntion
to pull the metadata from a connection. This should return alist
or an object which can be converted to a list withas.list
.- ...
Additional arguments applied to pull function. In case when this object code depends on the
raw_data
from the otherTealDataset
,TealDatasetConnector
object(s) or other constant value, this/these object(s) should be included. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.- parent
(
character
, optional) parent dataset name
Details
Create a TealDatasetConnector
from .R
file.
Create a CDISCTealDatasetConnector
from script
file with keys assigned
automatically by dataname
.
Examples
if (FALSE) {
x <- script_dataset_connector(
dataname = "ADSL",
file = "path/to/script.R",
keys = get_cdisc_keys("ADSL")
)
x$get_code()
}