From ripley at stats.ox.ac.uk  Mon Apr  9 10:48:29 2012
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 09 Apr 2012 09:48:29 +0100
Subject: [Rd] Add DUP = FALSE when tabulate() calls .C("R_tabulate"
In-Reply-To: <yajfr4vyoysu.fsf@gmail.com>
References: <yajfr4vyoysu.fsf@gmail.com>
Message-ID: <4F82A25D.7060901@stats.ox.ac.uk>

On 08/04/2012 19:37, Tim Hesterberg wrote:
> In base/R/tabulate.R, tabulate() calls .C("R_tabulate";
> I suggest adding DUP = FALSE to that call.

We can do that.  Note that R-patched already does less copying[*], but 
adding DUP=FALSE may avoid one copy of 'dup' if it is an integer vector. 
  We can avoid another for a factor ....

[*] tracemem() is still reporting 'copies' that are not full duplications.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Add DUP = FALSE when tabulate() calls .C("R_tabulate"
Prof Brian Ripley