ERROR: failed to lock directory ‘C:\Users\User\Documents\R\win-library\4.0’ for modifying Try removing ‘C:\Users\User\Documents\R\win-library\4.0/00LOCK’

There isn't really much to go on here. If you're having trouble with some code, be sure to include a reproducible example.