Re: [R] Sum of column from another df based of row values of df1

2012-09-09 Thread Shivam
Just to add, I did not know that the speed of data access is so much different in matrix and dataframes. This is one for the future. Thanks again Jim :) -Shivam On Mon, Sep 10, 2012 at 3:29 AM, Shivam wrote: > Thanks a lot Jim, it works a treat. Just had to change the date format > in the mCALL

Re: [R] Sum of column from another df based of row values of df1

2012-09-09 Thread Shivam
Thanks a lot Jim, it works a treat. Just had to change the date format in the mCALL as well. But you saved me 80 hours of fretting and frustration. Really thankful for it. Regards, Shivam On Mon, Sep 10, 2012 at 1:33 AM, jim holtman wrote: > How about an improvement to 16 seconds. The first thi

Re: [R] Sum of column from another df based of row values of df1

2012-09-09 Thread jim holtman
How about an improvement to 16 seconds. The first thing to do is to convert you data to a matrix because accessing data in a dataframe is very expensive. If you run Rprof on your code you will see that all the time is spent in retrieving the information. Converting to a matrix and using matrix a

[R] Sum of column from another df based of row values of df1

2012-09-09 Thread Shivam
Dear All, I need to sum a column from another dataframe based on the row values of one dataframe. I am stuck in a loop trying to accomplish it and at current speed it will take more than 80 hours to complete. Needless to say I am looking for a more elegant/quicker solution. Really need some help h