Skip to content
Prev 12116 / 398502 Next

dissimilarity structure

On Tue, 3 Jul 2001, Francois Deshaies wrote:

            
One way is

  m<-matrix(ncol=4,nrow=4)
  m[lower.tri(m)]<-your.dissimilarity.vector
  as.dist(m)

In fact, dissimilarity objects are just vectors with some attributes,
[unclass() a dist object to see], so you could just put these attributes
on your vector.  This is stylistically a bad idea, since in theory the
internal structure of "dist" objects could change at any time, but it
would probably work.


	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._