Bert, Jim, Dimitris and Joris,
Thank you all very much for your prompt help and suggestions.
After trying the ideas out, I have decided to go with Bert's approach
since it is by far the fastest of the lot.
Thanks again!
Rama Ramakrishnan
On Oct 8, 2009, at 12:49 PM, Bert Gunter wrote
a for loop stepping through each
row in d, and within the loop have another loop going through all the
rows again, checking for equality. This is quadratic in the number of
rows and takes way too long. Is there a better, vectorized way to do
this?
Thanks in advance!
Rama Ramakrishnan
this is with a FOR loop
for (i in 1:nrow(y)) {y$val[i] - x[y$ltrs[i],y$mnths[i]]}
My question: Is there a more efficient way (e.g., one without using an
explicit loop) to do this?
Thanks in advance!
-Rama Ramakrishnan
[[alternative HTML version deleted
this?
Thanks in advance!
-Rama Ramakrishnan
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
That works!! Very nice way to do it! Thank you, Henrique!
Rama Ramakrishnan
On Thu, Jun 25, 2009 at 10:11 AM, Henrique Dallazuanna www...@gmail.comwrote:
Try this:
y$values - diag(x[y$ltrs, y$mnths])
On Thu, Jun 25, 2009 at 11:02 AM, Rama Ramakrishnan r...@alum.mit.eduwrote:
Dear R-Users
Follow-on question: is there a way to do this for higher-dimensional (i.e.
more than 2 dimensions) arrays?
On Thu, Jun 25, 2009 at 10:17 AM, Rama Ramakrishnan r...@alum.mit.eduwrote:
That works!! Very nice way to do it! Thank you, Henrique!
Rama Ramakrishnan
On Thu, Jun 25, 2009 at 10:11
Thanks, David, that works too!
On Thu, Jun 25, 2009 at 10:30 AM, David Winsemius dwinsem...@comcast.netwrote:
On Jun 25, 2009, at 10:24 AM, Rama Ramakrishnan wrote:
Follow-on question: is there a way to do this for higher-dimensional (i.e.
more than 2 dimensions) arrays?
The apply
...@alum.mit.edu
wrote:
Follow-on question: is there a way to do this for higher-dimensional
(i.e.
more than 2 dimensions) arrays?
On Thu, Jun 25, 2009 at 10:17 AM, Rama Ramakrishnan r...@alum.mit.edu
wrote:
That works!! Very nice way to do it! Thank you, Henrique!
Rama Ramakrishnan
8 matches
Mail list logo