[R] updating elements of a vector sequentially - is there a faster way?

2012-08-23 Thread Gopi Goteti
I would like to know whether there is a faster way to do the below operation (updating vec1). My objective is to update the elements of a vector (vec1), where a particular element i is dependent on the previous one. I need to do this on vectors that are 1 million or longer and need to repeat that

[R] total CPU time in Matlab - what is the equivalent in R?

2012-08-26 Thread Gopi Goteti
I am trying to compare the speed of my R code with that reported by the authors of a reference paper who used Matlab. The authors of the paper state "Total CPU time for the algorithm was 10 s for the ...on a modest mobile 2.2 GHz Pentium processor running MATLAB v.6". I am using proc.time (similar