tableau_invoke: Programatically invoke a Tableau extension function

Description Usage Arguments Value Examples

View source: R/client.R

Description

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

Usage

1
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

1
2
3
4
pr_path <- system.file("plumber/stringutils/plumber.R",
  package = "plumbertableau")

tableau_invoke(pr_path, "/lowercase", LETTERS[1:5])

plumbertableau documentation built on Aug. 6, 2021, 9:05 a.m.