English 中文(简体)
如何利用R的雷克力逃脱或沉浸?
原标题:How escape or sanatize slash using regex in R?

I m 试图在R.的一个(表格)卷宗中读。 当我想读到包括<代码>/在内的一栏时,我就有一个错误。

doSomething <- function(dataset) {
     a <- dataset$data_transfer.Jingle/TCP.total_size_kb
     ...
     }

错误说,不能找到这个物体。 我用斜坡对 escaping进行了尝试,但没有工作。

如果有人提出某种想法,我真的赞赏!

最佳回答

口粮

head(dataset)

并看看它的名字。 也许会这样:

dataset$data_transfer.Jingle.TCP.total_size_kb
问题回答

两种方式:

dataset[["data_transfer.Jingle/TCP.total_size_kb"]]

dataset$`data_transfer.Jingle/TCP.total_size_kb`




相关问题
How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

Do I need to escape this?

It might be a bit unusual, but I need to echo <?php. However, I think that PHP treats it as an actual <?php and starts executing code instead of treating it as a string. How can I escape <?...

热门标签