execSpotfireAnalytic
Spotfire Statistics Services functions to run Spotfire analysis requests

### Description

Takes a list describing inputs from Spotfire, an S script or function name saying how to process them, and a list of outputs to send back to Spotfire, and then runs the script or function and sends the requested outputs back to Spotfire.

### Usage

    execSpotfireAnalyticScript(script, inputs, outputs,
        packages = character(), debug = FALSE, check = TRUE, control)
    execSpotfireAnalyticFunction(functionName, inputs, outputs,
        packages = character(), debug = FALSE, check = TRUE, control)
    execSpotfireAnalytic(analyticType, scriptOrFunctionName,
    	inputs = list(), outputs = list(),
        packages = character(), debug = FALSE, check = TRUE, control)

### Arguments

script | An S expression or a character string than can be parsed by parse() to make an expression.
functionName | A character string that names a function.
inputs | A list of input descriptors. An input descriptor is a list with at least the components "name" and "value" (and perhaps "isReference") and "type". "name" is the S-PLUS name of the input and should be a name used in the script. "isReference" is a logical scalar indicating whether the "value" component is the name of a *.sbdf file artifacts part of the WebDAV area associated with the Spotfire Statistics Services, or whether "value" contains the value of "name" directly. When "isReference" is TRUE, "type" is used to determine how to deal with an sbdf file containing a single column Spotfire table: If "type" is "table", the data is interpreted as a data.frame. If "type" is "matrix", the data is interpreted as a matrix. If "type" is "vector", the data is interpreted as a single column (a vector) without being part of a data.frame. (The data must have only one column or an error will occur.) If "type" is missing, it is assumed that "table" was meant. The default for "isReference" is FALSE.
outputs | A list of output descriptors. Each output descriptor is a list with at least the component "name", which contains the name of an object that should be returned to Spotfire. If there is a scalar logical component called "isReference", and if it is TRUE, then the object is stored in the file specified by the "value" component.
packages | A character vector listing the names of packages required to run the script. These are loaded with library(pkg,first=TRUE) before the script is run.
debug | A logical scalar. If TRUE, these functions write to the server's standard output a synopsis of each of the inputs and outputs, as seen by the server. If FALSE (the default), it does not write this information.
check | A logical scalar. If TRUE (the default), execSpotfireAnalyticFunction checks that the names on the inputs list match exactly the names of the arguments to functionName. If functionName does not have an ellipsis in its argument list, such a mismatch is considered an error; otherwise, a warning is given. check=TRUE also causes execSpotfireAnalyticFunction to verify that all names in the output list match exactly the names in the list output by functionName.
analyticType | A character string, either "script" or "functionName", to tell the general execSpotfireAnalytic function whether to call execSpotfireAnalyticScript or execSpotfireAnalyticFunction, respectively.
scriptOrFunctionName | Passed by execSpotfireAnalytic as the script argument to execSpotfireAnalyticScript or the functionName argument to execSpotfireAnalyticFunction.

### Details

SBDF is Spotfire's Binary Data Format and can be read and written by functions in the Spotfire S+ package "Spotfire" or by functions in the Spotfire Statistics Services APIs for other languages like C#.
The various APIs to Spotfire Statistics Services have ways of uploading files to a given user's part of the server's WebDAV area. This area is usually .../webdav/artifacts/spotfire/users/<user.name>
execSpotfireAnalyticScript is the basic function. execSpotfireAnalyticFunction creates a script from the function name and input and output lists, and then hands it to execSpotfireAnalyticScript. execSpotfireAnalytic takes all of the arguments of the others, along with a flag to say which of them to call.
Value
returns a list containing output descriptors. The output descriptors are like the ones input to the function but always contain "value" and "isReference" components. If "isReference" is TRUE, value is the name of a file relative to WEBDAV_ROOT/artifacts, and you can retrieve it via WebDAV or the ArtifactManager. Otherwise the "value" component contains the literal value.
See Also
exportDataToSBDF, importDataFromSBDF
Package SpotfireConnector version 6.1.5-18
Package Index