gather with tidyr: position must be between 0 and n error

99封情书 提交于 2019-12-05 04:38:09
x.row10  %>% gather(Year, Val, c(2:8))
z4.

The question is marked as solved, but I think it may be useful to post my answer. The way David Arenburg does is right. You need exact backticks for it to work. If you use the quotation marks as @uncool in the comments did, you get the same error like him:

Error: All select() inputs must resolve to integer column positions.
The following do not:
*  c("2004":"2009", "2012")

For the German keyboard users: If you don't know how to type backtick (like me a few minutes ago):

"Shift + the key on the right side of ß" and, after that, "spacebar".

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!