From h.wickham at gmail.com  Fri Feb 15 03:35:37 2013
From: h.wickham at gmail.com (Hadley Wickham)
Date: Thu, 14 Feb 2013 20:35:37 -0600
Subject: [Rd] stopping finalizers
In-Reply-To: <CAJ55+dJVjg9tN9RZB7Fk2twg-vO6zehXKFj2RU+HAhugVm9bsg@mail.gmail.com>
References: <CAJ55+dJogFHu3bXBFSjDGynsH0FKN4A15=5uWg_KS4XTaEOSCA@mail.gmail.com>
	<alpine.DEB.2.02.1302140544570.17940@luke-Latitude>
	<CAJ55+dJVjg9tN9RZB7Fk2twg-vO6zehXKFj2RU+HAhugVm9bsg@mail.gmail.com>
Message-ID: <CABdHhvG+2mdXCpGdHn9DfzQpUsU3dAndPCZ+2eoof+gvShAUig@mail.gmail.com>

> There are R objects representing survey data sets, with the data stored in
> a database table.  The subset() method, when applied to these objects,
> creates a new table indicating which rows of the data table are in the
> subset -- we don't modify the original table, because that breaks the
> call-by-value semantics. When the subset object in R goes out of scope, we
> need to delete the extra database table.

Isn't subset slightly too early to do this?  It would be slightly more
efficient for subset to return an object that creates the table when
you first attempt to modify it.

Hadley

-- 
Chief Scientist, RStudio
http://had.co.nz/



[Rd] stopping finalizers
Hadley Wickham