mutate error in code

Post a reproducible example and maybe we might be able to tell you.