search for: distancematrix

Displaying 6 results from an estimated 6 matches for "distancematrix".

2008 Feb 19
1
rJava and matrices
...in various combinations to no avail. The only way I can think of to solve this is to modify the java code to allow me to upload a row of the matrix one at a time. Any other ideas? > require(rJava); Loading required package: rJava > t = rbind(c(1,2,3),c(2,3,4),c(1,2,10)); > .jinit() > distanceMatrix = .jnew("data/structure/DistanceMatrix"); > .jmethods(distanceMatrix); ... other methods omitted for brevity ... [4] "public void data.structure.DistanceMatrix.setDistances(double[][])" > .jcall(distanceMatrix, "V", "setDistances", as.matrix(t)); Er...
2011 Sep 25
4
Trouble creating and adjacency matrix
...I'm having trouble creating an adjacency matrix. Basically, I need to turn the following distance matrix into an adjacency matrix based on whether values are >1.5 or not. If they are >1.5, then the returned value should be 0. If they are =<1.5, then the returned value should be 1. DistanceMatrix: A B C D E [1,] 0.000000 2.828427 1.581139 2.236068 2.000000 [2,] 2.828427 0.000000 1.581139 4.123106 2.000000 [3,] 1.581139 1.581139 0.000000 2.549510 2.121320 [4,] 2.236068 4.123106 2.549510 0.000000 4.123106 [5,] 2.000000 2.000000 2.121320 4....
2011 Jan 20
1
Problems with ecodist
...have locality data and shape variation data, and the two distance matrixs are given as belowings. When I run the analysis, it is always report that the matrix is not square, but I didn't know what's wrong with my data. Would you please help me on this. I am quite new to R. Thanks. > distancematrix <- as.matrix(read.table("test1.txt")) > distancematrix1 <- as.matrix(read.table("test2.txt")) > distancematrix1 Loc1 Loc2 Loc3 Loc4 Loc5 Loc6 Loc7 Loc8 Loc9 Loc10 Loc11 Loc12 Loc1 0.000 2293.8671 2180....
2011 Sep 26
3
Nearest neighbour in a matrix
Hello all, I am brand new to R and doing an exercise for a class. I need to find the nearest neighbour for points in the following matrix: > DistanceMatrix x1 x2 x3 x4 x5 [1,] 0.000000 2.828427 1.581139 2.236068 2.000000 [2,] 2.828427 0.000000 1.581139 4.123106 2.000000 [3,] 1.581139 1.581139 0.000000 2.549510 2.121320 [4,] 2.236068 4.123106 2.549510 0.000000 4.123106 [5,] 2.000000 2.000000 2.121320 4.123106 0.000000...
2008 Jan 25
1
How to execute R code
Hi, I have 'R' code in file. saved it as exmaple.r here is the code....... library("hopach") GSE <- read.table("gene_expression_data",sep="\t",header=TRUE,row.names=TRUE) gene.dist <- distancematrix(t(GSE),d="euclid") gene.hobj <- hopach(t(GSE), dmat=gene.dist, mss="med") labelstosil(gene.hobj$cluster$label,gene.dist) I dont know how to run it on linux terminal. Can you tell me how to execute this file. I am using Debian linux. Regards, Praeek Singh -- Prateek Singh...
2011 Jan 04
5
Help with "For" instruction
Hi, I am having a problem in doing something similar to this example: Suppose I have this vector a, and from it I wish to create 5 other vector each one with less one value than what object a has So I have "a" a<-c(1,2,3,4,5) and I want a1 that shoud have (2,3,4,5) a2 that should have (1,3,4,5) a3 that should have (1,2,4,5) a4 that should have (1,2,3,5) a5 that should have