<div><br></div><div class="gmail_quote">2011/11/8 Matthew Dowle <span dir="ltr">&lt;<a href="mailto:mdowle@mdowle.plus.com">mdowle@mdowle.plus.com</a>&gt;</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">
&gt; Interesting! I posted that problematic suggestion is because it worked<br>
&gt; for me in other case before. I was trying to overwrite data.table&#39;s<br>
&gt; default argument: &#39;nomatch&#39; = 0 instead of NA. I can&#39;t find a smart<br>
&gt; way to do it, </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">We could very easily make the default changeable by user. It&#39;s just<br>
changing the argument to be nomatch=getOption(&quot;datatable-nomatch&quot;,NA),<br>
so then you can put &quot;options(datatable-nomatch=0)&quot; in your .Rprofile.<br>
Shall we do that?</blockquote><div><br></div><div>Oh, I will be moved to tears if you are willing to do that! ^^ Actually, I remember we already used this option for some arguments. And I was wishing &#39;nomatch&#39; has it, too. I was afraid to ask for this favor, but I am glad you are willing help now. </div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
&gt; and I end up with overwrite whole data.table function. At that time,<br>
&gt; data.table.fn &lt;- function() {...} is not enough.<br>
<br>
</div>It would be enough, normally. But most data.table functions start with a<br>
call to cedta() [Calling Environment Data Table Aware]. That&#39;s how the<br>
switch to [.data.frame happens for non-datatable-aware packages.  As<br>
soon as a function exists in .GlobalEnv, though, cedta() believes it is<br>
datatable aware and it won&#39;t work as expected when called by a<br>
non-datatable-aware package (guessing what the problem was in your<br>
case). It depends on namespaces to do that, and where the function is,<br>
see data.table:::cedta.</blockquote><div><br></div><div>This is out of my knowledge and I appreciate that you point it out. Thank you, Matthew! </div><div> </div></div>Best regards,