[R] distance matrix as text file - how to import?
bibiko at eva.mpg.de
Tue Apr 8 20:50:53 CEST 2008
I have -hopefully- a tiny problem.
I was sent a text file containing a distance matrix à la:
4 5 6
Now I wanted to import these data into a dist object to, let's say,
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:
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.
More information about the R-help