Solution to replace mutate() with other solution

Could you post a complete reprex that shows the error generated? It's very difficult to sort out what's going on without one. You can follow the instructions I posted here.