Description Usage Arguments Examples
This function allows for a local R function to be run on vertica as a user defined function and returns a vertica.dplyr table as the output. The prerequisite udx called vertica_function_executor must be installed to use this function.
1 | execute_custom_R_udf(fun, tbl, ..., libraries)
|
fun |
An R function to be run in vertica as a user defined function. The function must input a data.frame and also output a data.frame |
tbl |
A vertica.dplyr table object to be passed into the function |
... |
Additional arguments that are passed to the function. The size of the objects passed to vertica (this includes the function passed) must be less than 30 MB |
libraries |
A vector of library names to be loaded before the function is executed. These libraries must be already installed on Vertica |
1 2 3 4 5 6 7 8 9 | ## Not run:
library(randomForest)
model <- randomForest(Species ~ ., iris,ntree = 1)
copy_to(vertica, iris, "iris_table")
iris_table <- tbl(vertica, "iris_table")
result <- execute_custom_R_udf(function(x) {library(randomForest); predict(model,x)}, iris_table, model = model, libraries = c("randomForest"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.