Creates an object that can translate arguments from Tableau to R, and return values from R to Tableau.

tableau_handler(args, return, func)

Arguments

args

A named list describing the arguments that are expected from valid Tableau requests. The names in the named list can be any unique variable names. The values in the named list must each be either a string indicating the expected data type for that argument ("character", "logical", "numeric", or "integer"); or better yet, a specification object created by arg_spec(). If an argument should be considered optional, then its data type should be followed by ?, like "numeric?".

return

A string indicating the data type that will be returned from func ("character", "logical", "numeric", or "integer"); or, a specification object created by return_spec().

func

A function to be used as the handler function. Code in the body of the function will automatically be able to access Tableau request args simply by referring to their names in args; see the example below.

Value

A tableau_handler object that is a validated version of the provided func with additional attributes describing the expected arguments and return values