Skip to contents

[Stable] Set arguments of a CallableFunction

Usage

set_args(x, args)

# S3 method for CallableFunction
set_args(x, args)

# S3 method for CallableCode
set_args(x, args)

# S3 method for TealDatasetConnector
set_args(x, args)

Arguments

x

CallableFunction or TealDatasetConnector)

args

(NULL or named list) dynamic arguments to function

Value

nothing

Examples

## Using CallableFunction
library(scda)
f <- function(df) {
  synthetic_cdisc_data("latest")[[df]]
}
fun <- callable_function(f)
set_args(fun, list(df = "adsl"))
## Using CallableCode
library(scda)
f <- function(df) {
  synthetic_cdisc_data("latest")[[df]]
}
code <- callable_code("f()")
set_args(code, list(df = "adsl"))
#> Warning: 'CallableCode' is unchangable. Ignoring arguments set by 'set_args'
## Using TealDatasetConnector
ds <- dataset_connector("x", pull_callable = callable_function(data.frame))
set_args(ds, list(x = 1:5, y = letters[1:5]))