On Sat, 3 Sep 2016, Bert Gunter wrote:

Chuck et. al.:

As I said previously, my intuition about the relative efficiency of
tapply() and duplicated() in the context of this thread was wrong.

My `intuition' was wrong, too.

But tapply() uses split() which runs quite fast. So not a big surprise, but if you look thru tapply() you'll notice it is well crafted in other ways. In particular, the way the `f' arg of split is constructed makes a big difference in timing (using a for loop to build up a mixed radix number). In fact interaction(f,g) needs about 3 times the time of tapply(f,list(f,g)) for just building an index.

Thanks for following up.

Best,

Chuck

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to