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.