Error running analysis after deleting rows from data frame