I don't see why making copies of the columns you need inside the loop is
better memory management. If the data are in a matrix, accessing
elements is quite fast. If you're worrying about speed of that, do what
Charles suggest: work with the transpose so that you are accessing
elements in the
Liaw, Andy wrote:
I don't see why making copies of the columns you need inside the loop is
better memory management. If the data are in a matrix, accessing
elements is quite fast. If you're worrying about speed of that, do what
Charles suggest: work with the transpose so that you are
On Tue, 20 Feb 2007, Federico Calboli wrote:
Liaw, Andy wrote:
I don't see why making copies of the columns you need inside the loop is
better memory management. If the data are in a matrix, accessing
elements is quite fast. If you're worrying about speed of that, do what
Charles
Charles C. Berry wrote:
This is a bit different than your original post (where it appeared that
you were manipulating one row of a matrix at a time), but the issue is
the same.
As suggested in my earlier email this looks like a caching issue, and
this is not peculiar to R.
Viz.
Hi All,
I would like to ask the following.
I have an array of data in an objetct, let's say X.
I need to use a for loop on the elements of one or more columns of X and I am
having a debate with a colleague about the best memory management.
I believe that if I do:
col1 = X[,1]
col2 = X[,2]
On Mon, 19 Feb 2007, Federico Calboli wrote:
Hi All,
I would like to ask the following.
I have an array of data in an objetct, let's say X.
I need to use a for loop on the elements of one or more columns of X and I am
having a debate with a colleague about the best memory management.
Charles C. Berry wrote:
Whoa! You are accessing one ROW at a time.
Either way this will tangle up your cache if you have many rows and
columns in your orignal data.
You might do better to do
Y - t( X ) ### use '-' !
for (i in whatever ){
do something using Y[ , i ]
}
My