Markku Karhunen wrote:
Hi,

Does anybody know, what is going on here?

diag( x ) produces a round(x) x round(x) identity matrix when x is length 1. (This is the third case listed on the man page ?diag). See the note there about a safer form if you wanted a matrix with x on the diagonal.

Duncan Murdoch
diag(sqrt(1))
      [,1]
[1,]    1
diag(sqrt(0.3333))
<0 x 0 matrix>
sqrt(1)
[1] 1
sqrt(0.3333)
[1] 0.5773214

BR, Markku Karhunen
researcher
University of Helsinki

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to