5

比较这种行为,

df <- data.frame(a11111 = rnorm(5,0), b11111= rnorm(5,0))
df$a # pressing tab at this instance auto-completes a11111
df$a # hitting return at this instance returns the value for a11111

这种行为:

library(data.table)
dt <- data.table(df)
dt[,a # pressing tab at this instance does not auto-complete a11111
dt[,a # pressing return at this instance returns an 'object not found' error
dt$a  # behaves like how it does for the data frame

我假设退货有效,因为x$name相当于x[["name", exact = FALSE]]?但是,我不明白自动完成的行为。由于data.table语法是基于的[,它是否实用和/或可能dt[,a <tab/return>像这样工作dt$a<tab/return>

我在 Windows 7 64 位上运行 Rstudio 0.97.551 和 R 版本 3.0.1。

4

1 回答 1

2

目前可以在最新的 RStudio 开发版本中使用。
如果在 data.table 自动完成方面有任何问题,您可以尝试在此问题中发表评论。

于 2014-12-18T20:04:58.200 回答