From h.wickham at gmail.com  Fri Sep 15 22:34:45 2006
From: h.wickham at gmail.com (hadley wickham)
Date: Fri, 15 Sep 2006 15:34:45 -0500
Subject: [Rd] An update method for lists?
In-Reply-To: <17675.2988.727158.326024@stat.math.ethz.ch>
References: <eb555e660609151222u2f1a7856l6b5f786c8677966@mail.gmail.com>
	<17675.2988.727158.326024@stat.math.ethz.ch>
Message-ID: <f8e6ff050609151334j7729b00cx5a7affcf6ca7794d@mail.gmail.com>

> If a list is used to store "defaults" and you want a safe way to
> change only a few of the values...
> I presume you use this for manipulating the settings of lattice
> parts ?

I use something similar in ggplot (except not recursive):

defaults <- function(x, y)  {
	c(x, y[setdiff(names(y), names(x))])
}

Hadley




[Rd] An update method for lists?
hadley wickham