Re: [R] How to build a large identity matrix faster?

2012-06-12 Thread Ceci Tam
that makes sense, thanks for the reply On 13 June 2012 05:53, Uwe Ligges wrote: > > > On 11.06.2012 11:45, Ceci Tam wrote: > >> diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for >> diag(5e3). However, it's slow when n = 23000, diag(23000) took 15 s

Re: [R] How to build a large identity matrix faster?

2012-06-11 Thread Ceci Tam
diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for diag(5e3). However, it's slow when n = 23000, diag(23000) took 15 sec On 11 June 2012 17:43, Ceci Tam wrote: > diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for > diag(5e3). However, it's slo

[R] How to build a large identity matrix faster?

2012-06-07 Thread Ceci Tam
Hello, I am trying to build a large size identity matrix using diag(). The size is around 23000 and I've tried diag(23000), that took a long time. Since I have to use this operation several times in my program, the running time is too long to be tolerable. Are there any alternative for diag(N)? Tha