Java Array Within Function In R Studio