Dear all,

I have -hopefully- a tiny problem.

I was sent a text file containing a distance matrix à la:

1
2 3
4 5 6

Now I wanted to import these data into a dist object to, let's say,  
do 'plot(hclust(v))'.

My first naïve approach was to scan the text file in order to get a  
vector v. Then I did:

class(v) <- "dist"
attr(v, "Size") <- 4

But, of course, I got this:

1
2 4
3 5 6

I wonder if there's an elegant way to do it. The only way I know of  
is very very stony one.

I'd be very appreciated for any hint.

Cheers,

--Hans

______________________________________________
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