For the following workflow:

According to the user, the expected # of output tuples of the R UDF should be equal to the # of input tuples.
Also, It takes 5 mins in Python script, but 20 mins using the workflow. According to the user's observation, the R UDF and Sort operator is the bottleneck.