While I came across this while working on a package that used S4, the code in the OP has those errors when run in the global environment. In the output below, I put data.table:::cedta() before and after loading RCurl, and it returns TRUE in both cases. The data.table object DT1 works fine before and after loading RCurl; DT2, object of the S4 class inheriting from data.table, is acting like a data.table object and not like a data.frame in all respects that I've looked at, except when I use an unquoted variable name in i. That works fine before loading RCurl, but fails after it. I have no idea what RCurl could be changing that would affect this, which is why I am stumped.<div>
<br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="courier new, monospace">> library("data.table")</font></div></div><div><div><font face="courier new, monospace">data.table 1.8.2 For help type: help("data.table")</font></div>
</div><div><div><font face="courier new, monospace">> sessionInfo()</font></div></div><div><div><font face="courier new, monospace">R version 2.15.1 (2012-06-22)</font></div></div><div><div><font face="courier new, monospace">Platform: x86_64-unknown-linux-gnu (64-bit)</font></div>
</div><div><div><font face="courier new, monospace"><br></font></div></div><div><div><font face="courier new, monospace">locale:</font></div></div><div><div><font face="courier new, monospace"> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C </font></div>
</div><div><div><font face="courier new, monospace"> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 </font></div></div><div><div><font face="courier new, monospace"> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 </font></div>
</div><div><div><font face="courier new, monospace"> [7] LC_PAPER=C LC_NAME=C </font></div></div><div><div><font face="courier new, monospace"> [9] LC_ADDRESS=C LC_TELEPHONE=C </font></div>
</div><div><div><font face="courier new, monospace">[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C </font></div></div><div><div><font face="courier new, monospace"><br></font></div></div><div><div><font face="courier new, monospace">attached base packages:</font></div>
</div><div><div><font face="courier new, monospace">[1] stats graphics grDevices utils datasets methods base </font></div></div><div><div><font face="courier new, monospace"><br></font></div></div><div><div>
<font face="courier new, monospace">other attached packages:</font></div></div><div><div><font face="courier new, monospace">[1] data.table_1.8.2</font></div></div><div><div><font face="courier new, monospace">> ## cedta is TRUE</font></div>
</div><div><div><font face="courier new, monospace">> data.table:::cedta()</font></div></div><div><div><font face="courier new, monospace">[1] TRUE</font></div></div><div><div><font face="courier new, monospace">> </font></div>
</div><div><div><font face="courier new, monospace">> setClass("DataTable2", contains="data.table")</font></div></div><div><div><font face="courier new, monospace">> </font></div></div><div><div>
<font face="courier new, monospace">> DT1 <- data.table(x=rep(c("a","b","c"),each=3), y=c(1,3,6), v=1:9)</font></div></div><div><div><font face="courier new, monospace">> DT2 <- new("DataTable2", data.table(x=rep(c("a","b","c"),each=3), y=c(1,3,6), v=1:9))</font></div>
</div><div><div><font face="courier new, monospace">> </font></div></div><div><div><font face="courier new, monospace">> library("RCurl")</font></div></div><div><div><font face="courier new, monospace">Loading required package: bitops</font></div>
</div><div><div><font face="courier new, monospace">> sessionInfo()</font></div></div><div><div><font face="courier new, monospace">R version 2.15.1 (2012-06-22)</font></div></div><div><div><font face="courier new, monospace">Platform: x86_64-unknown-linux-gnu (64-bit)</font></div>
</div><div><div><font face="courier new, monospace"><br></font></div></div><div><div><font face="courier new, monospace">locale:</font></div></div><div><div><font face="courier new, monospace"> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C </font></div>
</div><div><div><font face="courier new, monospace"> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 </font></div></div><div><div><font face="courier new, monospace"> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 </font></div>
</div><div><div><font face="courier new, monospace"> [7] LC_PAPER=C LC_NAME=C </font></div></div><div><div><font face="courier new, monospace"> [9] LC_ADDRESS=C LC_TELEPHONE=C </font></div>
</div><div><div><font face="courier new, monospace">[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C </font></div></div><div><div><font face="courier new, monospace"><br></font></div></div><div><div><font face="courier new, monospace">attached base packages:</font></div>
</div><div><div><font face="courier new, monospace">[1] stats graphics grDevices utils datasets methods base </font></div></div><div><div><font face="courier new, monospace"><br></font></div></div><div><div>
<font face="courier new, monospace">other attached packages:</font></div></div><div><div><font face="courier new, monospace">[1] RCurl_1.95-0 bitops_1.0-4.1 data.table_1.8.2</font></div></div><div><div><font face="courier new, monospace">> ## cedta is still TRUE</font></div>
</div><div><div><font face="courier new, monospace">> data.table:::cedta()</font></div></div><div><div><font face="courier new, monospace">[1] TRUE</font></div></div><div><div><font face="courier new, monospace">> </font></div>
</div><div><div><font face="courier new, monospace">> ## This still works</font></div></div><div><div><font face="courier new, monospace">> DT1[,v]</font></div></div><div><div><font face="courier new, monospace">[1] 1 2 3 4 5 6 7 8 9</font></div>
</div><div><div><font face="courier new, monospace">> ## This no longer works</font></div></div><div><div><font face="courier new, monospace">> DT2[,v]</font></div></div><div><div><font face="courier new, monospace">Error: object 'v' not found</font></div>
</div><div><div><font face="courier new, monospace">> </font></div></div><div><div><font face="courier new, monospace">> ## DT2 still behaving like data.table and not data.frame in other respects</font></div></div><div>
<div><font face="courier new, monospace">> DT2[ , 4]</font></div></div><div><div><font face="courier new, monospace">[1] 4</font></div></div><div><div><font face="courier new, monospace">> DT2[ , "v"] # returns v instead of the column</font></div>
</div><div><div><font face="courier new, monospace">[1] "v"</font></div></div><div><div><font face="courier new, monospace">> DT2[ , "v", with=FALSE] # returns the column</font></div></div><div><div>
<font face="courier new, monospace"> v</font></div></div><div><div><font face="courier new, monospace">1: 1</font></div></div><div><div><font face="courier new, monospace">2: 2</font></div></div><div><div><font face="courier new, monospace">3: 3</font></div>
</div><div><div><font face="courier new, monospace">4: 4</font></div></div><div><div><font face="courier new, monospace">5: 5</font></div></div><div><div><font face="courier new, monospace">6: 6</font></div></div><div><div>
<font face="courier new, monospace">7: 7</font></div></div><div><div><font face="courier new, monospace">8: 8</font></div></div><div><div><font face="courier new, monospace">9: 9</font></div></div></blockquote><div><div><br>
</div><div><br><div class="gmail_quote">On Sat, Sep 29, 2012 at 8:34 PM, Steve Lianoglou <span dir="ltr"><<a href="mailto:mailinglist.honeypot@gmail.com" target="_blank">mailinglist.honeypot@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div class="im"><br>
On Sat, Sep 29, 2012 at 6:21 PM, Matthew Dowle <<a href="mailto:mdowle@mdowle.plus.com">mdowle@mdowle.plus.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> Quick answer to start. Assuming your package Imports or Depends on<br>
> data.table (in the DESCRIPTON file) then see here for description of<br>
> `cedta` and how it works and maybe it needs a fix :<br>
><br>
> <a href="http://stackoverflow.com/a/10529888/403310" target="_blank">http://stackoverflow.com/a/10529888/403310</a><br>
<br>
</div>Quick note: this doesn't look like it has to do w/ cedta ... I was<br>
debugging this w/ the sample provided and cedta() returns TRUE.<br>
<br>
Somehow ~ line 780 of data.table.R, `xvars` is empty and I guess the<br>
column is injected into the SDenv befure the `jval = eval(jsub,SDenv)`<br>
call, so its not found.<br>
<br>
-steve<br>
<br>
--<br>
Steve Lianoglou<br>
Graduate Student: Computational Systems Biology<br>
| Memorial Sloan-Kettering Cancer Center<br>
| Weill Medical College of Cornell University<br>
Contact Info: <a href="http://cbio.mskcc.org/~lianos/contact" target="_blank">http://cbio.mskcc.org/~lianos/contact</a><br>
</blockquote></div><br></div></div>