Update retention2.R

Added if statement for preIds