partners R script improvements