Re: [R] function odiag(): assigning values to off-diagonal

2010-03-01 Thread David Winsemius
On Mar 1, 2010, at 10:53 AM, Benedikt Gehr wrote: hi I'm trying to use the function odiag(x) for matrix calculations. You assume that everyone is using the package that contains odiag? I would like to assign new values to an off-diagonal in a matrix. When I use the diag (x) function I coul

[R] function odiag(): assigning values to off-diagonal

2010-03-01 Thread Benedikt Gehr
hi I'm trying to use the function odiag(x) for matrix calculations. I would like to assign new values to an off-diagonal in a matrix. When I use the diag (x) function I could write something like p<-matrix(seq(1:12),ncol=4) p.new<-matrix(rep(0,12),ncol=4) diag(p.new)<-diag(p) p.new But this w