That is a good suggestion, and something I probably should have tried already. Although when I use

SparkR::collect

I get a JVM error:

java.lang.OutOfMemoryError: Requested array size exceeds VM limit