This happens because gather
requires a name and value argument (supplied as strings, hence the error message. I imagine that supplying this would solve your problem. However, I strong encourage you to change from gather
to the pivot
arguments as gather
has been retired. I think your code would work fine with pivot
. Please see links below and good luck!
solved Error in gathering many columns together using R [closed]