I am trying to integrate R and Tableau better and using Tableau Prep to try to alleviate that gap. However, I am not able to get a simple R script to run using Rserve. I have exported the Titanic to excel and just using that in the process flow.
I then have setup a localhost connection to Rserve. I am using the following script and getting errors:
titanic_test<-function(df){
library(tidyverse)
test<- data.frame(df) %>% mutate(New_Col = Freq * 10)
return(test)
}
getOutputSchema<- function() {
return(
data.frame(
ID = prep.string(),
Pclass = prep_string(),
Sex = prep.string(),
Age = prep_string(),
Survived = prep.string(),
Freq = prep.int(),
New_Col = prep_int()
)
)
The error is "Can't generate "Output.hyper" because there are errors in the flow. Fix the errors and then try running the flow again.". Is there a chance anyone can provide insight into this or perhaps it is not pinging my R instance correctly? I am trying to scale this up but cannot get a simple R script to execute.