I am new to using Tableau and R.
I am trying to call a R script within Tableau that returns a set of results.
My R script has a function called lessThanFn, that returns results from a column of data that are less than a specified number. In this particular case, I am wanting to return all Credit amounts that are less than 700.
However, when I drag and drop the calculated field in Tableau I receive an error message saying "the result returned by the SCRIPT function is of an unexpected type".
Below is my R code and the code used in Tableau to call the R script.
Thank you in advance for any help!
lessThanFn <- function(x,y)
for(i in 1:length(x))
Tableau code to call R script:
result <- lessThanFn(.arg1,.arg2)',ATTR([Credit]), ATTR(700))
Did you find the solution to this issue? If not, please mention me in your reply and I'll see if I can find someone with R skills to assist further.