> "jh" == jim holtman <[EMAIL PROTECTED]>
> on Fri, 25 Jul 2008 12:34:49 -0400 writes:
> "jh" == jim holtman <[EMAIL PROTECTED]>
> on Fri, 25 Jul 2008 12:34:49 -0400 writes:
jh> Does this do what you want:
>> x <- matrix(1:25,5)
>> x
jh> [,1] [,2] [,3
Great, thanks for that Jim,
It does what I need it do do.
Regards,
Paul
jholtman wrote:
>
> Does this do what you want:
>
>> x <- matrix(1:25,5)
>> x
> [,1] [,2] [,3] [,4] [,5]
> [1,]16 11 16 21
> [2,]27 12 17 22
> [3,]38 13 18 23
> [4,]4
Does this do what you want:
> x <- matrix(1:25,5)
> x
[,1] [,2] [,3] [,4] [,5]
[1,]16 11 16 21
[2,]27 12 17 22
[3,]38 13 18 23
[4,]49 14 19 24
[5,]5 10 15 20 25
> x[upper.tri(x)] <- NA
> write.table(x, na="", row.names=FALSE,
Thanks Jim,
The morphometry software I mentioned outputs distance matrices in the
format:
0.
7.1598 0.
8.7241 8.3506 0.
9.5217 7.2457 2.5642 0.
I would have liked to write to a file the same type of matrix in R, to
ensure the same data format. Mantel for Windows is optimally set
How do you want the lower half written out? can you give us an
example of the input matrix and then what you would expect to see on
the output. Is it still a matrix with the upper half set to zero/NA?
Do you want it as a vector? What is the other program expecting as
input?
You need to provide
Hi,
I'm very new to R. I want to know if there is any way to write only the
lower half of a distance matrix created in R to a csv file for example. I
get the 'cannot coerce class "dist" into a data.frame' message when I try.
I have used as.matrix and can write to a file this way, but as a full
6 matches
Mail list logo