Programs for R specialreg package