Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

data.table and Auto-complete Compatibility

Compare this behaviour,

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

with this behaviour:

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

I assume the return works because x$name is equivalent to x[["name", exact = FALSE]]? However, I don't understand the auto-complete behaviour. Since the data.table syntax is based on [, is it practical and/or possible for dt[,a <tab/return> to work something like dt$a<tab/return>?

I'm running Rstudio 0.97.551 with R version 3.0.1 on Windows 7, 64 bit.

like image 776
TheComeOnMan Avatar asked Nov 02 '22 12:11

TheComeOnMan


1 Answers

It is currently possible in the latest dev version of RStudio.
In case of any issues in terms of data.table auto-complete you may try post comment in this issue.

like image 126
jangorecki Avatar answered Nov 09 '22 07:11

jangorecki