Re: [R] Suggestion on how to make permanent changes to a singleobject in a list?

From: Peter Waltman <>
Date: Fri, 04 Jan 2008 00:06:49 -0500

> fooStack[[1]] <- fooModifier(fooStack[[1]]) I thought of this idea as well, and may go with it, if the Gabor's environments idea doesn't work

> snip
> Peter, perhaps it would help if you gave us more context into why you 
> wanted this done, and perhaps then someone can suggest a more natural 
> approach. Perhaps there is a more "R" way to solve your original problem.
it's fairly simple, but basically, we have a "cluster" object (which is really just a list) that has several items in it, one of which is something that we call a colslice (basically, just several columns of expression matrices). In reality, this cluster is part of a larger "meta-cluster" for genes from several different organisms.

So, really the structure is:

clusterStack ( == list() )
clusterStack[[ 1 ]] = a cluster of the form:

cluster (== list() )
|->>cluster$bsubt ( == list() )


|->>cluster$banth ( == list() ) |

I'm writing a function that will be called by another which generates the clusters and clusterStack objects, and the inner function should return the results some calculations on the $colslice and $rowslice items.

I just wanted to have the inner function to retrieve the row/col slices from a MySQL database in case they haven't been set.

The other workaround is just to make sure that they're already set by the time the function is called, and have the function throw an error if they're not. In fact, that might be the better way to do it, to provide better "encapsulation".

I just wanted to see if it was possible to have the inner function set these.

Thanks for all the suggestions!

Peter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 04 Jan 2008 - 05:11:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Jan 2008 - 08:30:05 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive