R Package Survival Function