R utility functions used for single and repeat survey R code