0

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.

  • Also, I have verified that tidyverse and all supporting packages are in the R instance. – Bills_Mafia_17 May 14 '23 at 01:59
  • Could you provide a reproducible example? It is difficult to help you with this code. For example, if you could provide the data, it would be great. – Emmanuel Hamel May 14 '23 at 10:44
  • Don't include `library()` calls within a function definition. You would do this at the top of your R script. – Phil May 15 '23 at 00:16

0 Answers0