且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有一个解决方法来处理数据表中以数字开头的列吗?

更新时间:2023-11-26 18:47:22

从你最后一句话,我假设你正在寻找一个替代使用:

From your last sentence, I assume you're looking for an alternative to using:

> example[,"3M", with = FALSE]
          3M
1:  -0.38802
2:   1.20386
3: -22.14071

在这种情况下,如果你想要一个向量作为输出,你应该能够使用反引号(这仍然是一个拖动, ):

In this case, if you want a vector as the output, you should be able to use backticks (which is still a bit of a drag, but works):

> example[,`3M`]
[1]  -0.38802   1.20386 -22.14071