[R] Code working but too slow, any idea for how to speed it up ?(no loop in it)

Dan Davison davison at stats.ox.ac.uk
Fri Feb 12 22:48:58 CET 2010


anna <lippelanna24 <at> hotmail.com> writes:

> 
> Hello my friends, 
> here is a code I wrote with no loops on matrix that is taking too long (2
> seconds and I call him 720 times --> 12 minutes):
> 
> mat1 and mat2 are both matrix with 103 columns and 164 rows.

Could you provide some example code creating matrices mat1 and mat2 which have
exactly the same structure as the mat1 and mat2 you are using. We don't really
want your exact data, but just toy matrices that have exactly the same form as
your data matrices. Without that your question's hard to answer as we can't try
out your code. failing that, please post the output of str(mat1) and str(mat2).



More information about the R-help mailing list