Facing Issue in changing the data in the columns

The results of your use of trimws were not assigned to anywhere. You sjould be using <- to assign results in the normal way

Also please avoid using screenshots, they are hard to read, and not possible for us to copy and paste etc.