<div><br></div><div class="gmail_quote">2011/11/8 Matthew Dowle <span dir="ltr"><<a href="mailto:mdowle@mdowle.plus.com">mdowle@mdowle.plus.com</a>></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
> Interesting! I posted that problematic suggestion is because it worked<br>
> for me in other case before. I was trying to overwrite data.table's<br>
> default argument: 'nomatch' = 0 instead of NA. I can't find a smart<br>
> 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's just<br>
changing the argument to be nomatch=getOption("datatable-nomatch",NA),<br>
so then you can put "options(datatable-nomatch=0)" 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 'nomatch' 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">
> and I end up with overwrite whole data.table function. At that time,<br>
> data.table.fn <- 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'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'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,