I'm trying to use R and Tableau interactively, to run a model in R and visualize the results in Tableau.
My understanding is that the modeling data should be loaded in R.
I wrote this Calculated Field in Tableau to try to load data in R, however it keeps telling me that there's an unexpected return type. I don't know why it's trying to return any value yet.
SCRIPT_STR("
cat(' ',fill = T)
cat('*****************************************', fill = T)
cat('********** Loading Data in R ************', fill = T)
cat('*****************************************', fill = T)
cat(' ',fill = T)
path <- .arg1
print(path)
L1_stage_disposition <- readRDS(path)
", [Path to Data])
The parameter "Path to Data" in Tableau holds a valid reference to the desired RDS file. There is no error in Tableau until I add the line that says L1_stage_disposition <- readRDS(path)
.
If I use Rdata
instead of RDS
format data then I can see the data load in RStudio, however both give me the same error message about return types in Tableau.