Two fine points:
1) Since the MAX([R Param]) aggregation
gives a single value as a result,
you may want to use .arg1 in your script.
This tells R to read just a first value from a vector.
2) Your SCRIPT_INT() is a Table Calculation in Tableau.
So it has it's own Addressing & Partitioning logic.
Tableau sends as many vectors to R
as the number of partitions in the calc.
Please check the Edit Table Calculation
dialog for your SCRIPT_INT() Pill on a view.
Please make sure all Dimensions are selected
(under Specific Dimensions dialog option),
so all Marks on a view would become a single partition.
Hope it could help.
I think i have a solution to this problem , not with r though.
Part of the problem here may be that Tableau expects a value to be able to return to Tableau when the script has run. Placing the integer 1 at the end of the script for Tableau to return would be a way to show that this has been accomplished and allow Tableau to return something. Are you seeing results be written to the db from your code in Tableau?
Here is some further documentation on using Tableau's integrations for external services: