AnalysisPipeline or StreamingAnalysisPipeline objectRegister a user-defined function to be used with a AnalysisPipeline or StreamingAnalysisPipeline object
registerFunction(functionName, heading = "", functionType = "batch",
engine = "r",
exceptionFunction = as.character(substitute(genericPipelineException)),
isDataFunction = T, firstArgClass = "", loadPipeline = F,
userDefined = T)name of function to be registered
heading of that section in report
type of function - 'batch' for AnalysisPipeline objects, 'streaming' for StreamingAnalysisPipeline objects
specifies which engine the function is to be run on. Available engines include "r", "spark", and "python"
R object corresponding to the exception function
logical parameter which defines whether the function to be registered operates on data i.e. the first parameter is a dataframe
character string with the class of the first argument to the function, if it is a non-data function
logical parameter to see if function is being used in loadPipeline or not. This is for internal working
logical parameter defining whether the function is user defined. By default, set to true
The specified operation along with the heading and engine details is stored in the registry, after which it can be added to a pipeline.
If the function already exists in the registry, registration will be skipped. In order to change the definition, the function needs
to be reassigned in the Global Environment and then the registerFunction called again.
Other Package core functions: BaseAnalysisPipeline-class,
MetaAnalysisPipeline-class,
assessEngineSetUp,
checkSchemaMatch,
createPipelineInstance,
exportAsMetaPipeline,
generateOutput,
genericPipelineException,
getInput, getLoggerDetails,
getOutputById,
getPipelinePrototype,
getPipeline, getRegistry,
initDfBasedOnType,
initialize,BaseAnalysisPipeline-method,
loadMetaPipeline,
loadPipeline,
loadPredefinedFunctionRegistry,
loadRegistry, prepExecution,
savePipeline, saveRegistry,
setInput, setLoggerDetails,
updateObject,
visualizePipeline
# NOT RUN {
library(analysisPipelines)
getNumRows <- function(dataset){
return(nrow(dataset))
}
registerFunction("getNumRows")
# }
Run the code above in your browser using DataLab