Is there any way I can use the gather function in the tidyr package to gather columns whose names are numeric characters? For example:
0 1 1.5
0.072008549 0.0722986133 0.0724443032
0.016977539 0.0171147309 0.0171839512
0.007328922 0.0074180263 0.0074631892
0.002660683 0.0027039452 0.0027259732
0.000406033 0.0004143108 0.0004185449
As well as using backticks, you can refer to the columns by number:
gather(df, key, value, 2:3)
When you have numeric names, make sure to escape them using backticks "`". For example gather(d, key, value, `0`)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With