Create a new TealDatasetConnector
object
dataset_connector.Rd
Arguments
- dataname
(
character
)
A given name for the dataset it may not contain spaces- pull_callable
(
CallableFunction
)
function with necessary arguments set to fetch data from connection.- 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
.- vars
(named
list
))
In case when this object code depends on otherTealDataset
object(s) or other constant value, this/these object(s) should be included as named element(s) of the list. For example if this object code needsADSL
object we should specifyvars = list(ADSL = <adsl object>)
. It's recommended to includeTealDataset
orTealDatasetConnector
objects to thevars
list to preserve reproducibility. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.- 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
.
Details
Create TealDatasetConnector
from callable_function.
Examples
library(MultiAssayExperiment)
# data.frame example
pull_fun2 <- callable_function(data.frame)
pull_fun2$set_args(args = list(a = c(1, 2, 3)))
dataset_connector("test", pull_fun2)
#> A TealDatasetConnector object, named test, containing a TealDataset object that has not been loaded/pulled
# MultiAssayExperiment example
pull_fun <- callable_function(
function() {
library("MultiAssayExperiment")
data("miniACC")
return(miniACC)
}
)
dataset_connector(
"miniacc",
pull_fun,
code = 'library("MultiAssayExperiment"); data("miniACC"); return(miniACC)'
)
#> A TealDatasetConnector object, named miniacc, containing a TealDataset object that has not been loaded/pulled