makeFunction | R Documentation |
This function is the work-horse that generates the R code for a function with which we can interface to a REST method described by a WADL resource/method. This is repsonsible for creating the signature of the function, including the default values, and the body that invokes the method.
makeFunction(params, url, options = params$options, name = "foo", converter = "NULL",
action = "getForm",
OptionsCharacterThreshold = getOption("WADLOptionsCharacterThreshold", 5000L),
hooks = list(makeSignature = makeSignature, preCall = NULL, postCall = NULL))
params |
a description of the WADL method. This is a data frame
with as many rows as there are parmeters in the WADL method.
The columns are |
url |
the URL for this method's resource |
options |
a list with information about each parameter |
name |
the name of the R function to be created |
converter |
an optional expression or symbol name that identifies the default converter, if any, that can process the result of the REST invocation and turn it into a more meaningful R object. |
action |
the name of the R function (in RCurl) to call when making the REST request. This is typically either "getForm" or "postForm". |
OptionsCharacterThreshold |
an integer value that controls how big the size of the permissible values vector for a parameter must be before we make it a global variable. This is to avoid issues with functions being too long to read and maintain the source as text as an attribute. |
hooks |
a list with elements for any of the
|
If eval
is TRUE
or an environment, we define
the function in that environment (or globalenv
.
If eval
is FALSE
, we return the text (character vector)
containing the R code.
Duncan Temple Lang
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.