Simulates invoking a Tableau extension function from a Tableau calculated field SCRIPT_* call. Intended for unit testing of plumbertableau extensions.

tableau_invoke(pr, script, ..., .toJSON_args = NULL, .quiet = FALSE)

Arguments

pr

Either a tableau_extension style Plumber router object, or, the filename of a plumber.R that implements a Tableau extension.

script

The script string that identifies the plumber route to invoke. (Equivalent to the first argument to SCRIPT_STR, et al., in Tableau.) URL query parameters are allowed.

...

Zero or more unnamed arguments to be passed to the script.

.toJSON_args

Additional options that should be passed to jsonlite::toJSON() when the ... arguments are serialized; for example, pretty = TRUE or digits = 8.

.quiet

If TRUE, do not print response bodies when errors occur.

Value

The object that was returned from the request, JSON-decoded using jsonlite::parse_json.

Examples

pr_path <- system.file("plumber/stringutils/plumber.R", package = "plumbertableau") tableau_invoke(pr_path, "/lowercase", LETTERS[1:5])
#> Verbose logging is off. To enable it please set the environment variable `DEBUGME` to include `plumbertableau`. #>
#> [1] "a" "b" "c" "d" "e"