R package for SAPS