various swps R scripts