比较此行为,
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。