similar to: Trouble creating and adjacency matrix

Displaying 20 results from an estimated 700 matches similar to: "Trouble creating and adjacency matrix"

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
2001 May 16
2
Strange formatting
I've never noticed this before, though it's probably not new. In 1.2.3 for Windows, if I print a short vector the formatting is different than if I print a long one, whether or not they fit on one line. The short/long split appears to be between 9 and 10 elements: > 1:9 [1] 1 2 3 4 5 6 7 8 9 > 1:10 [1] 1 2 3 4 5 6 7 8 9 10 > sqrt(1:9) [1] 1.000000 1.414214
2008 Feb 19
1
rJava and matrices
Hi list, I'm wanting to use a matrix as input to some java code, but I seem to be unable to do this (See code below). When searching online for a solution I found that rJava 0.5-2 (the version under development not yet in CRAN) is adding "direct support for raw vectors as method parameters". Is this related? I also tried to use .jarray / .jcast in various combinations to no avail.
2011 Jan 20
1
Problems with ecodist
Dear Dr.Goslee and anyone may intrested in matrix manipulate, I am using your ecodist to do mantel and partial mantel test, I 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
2006 Aug 16
1
help about agnes
Hello. I have the following distance matrix between 8 points: [1,] 0.000000 3.162278 7.280110 8.544004 7.071068 9.899495 6.403124 8.062258 [2,] 3.162278 0.000000 5.000000 6.403124 4.472136 8.944272 6.082763 8.062258 [3,] 7.280110 5.000000 0.000000 1.414214 1.000000 5.000000 4.242641 5.830952 [4,] 8.544004 6.403124 1.414214 0.000000 2.236068 4.123106 4.472136 5.656854 [5,] 7.071068 4.472136
2004 Aug 30
3
Multiple lapply get-around
I am faced with a situation wherein I have to use multiple lapply's. The pseudo-code could be approximated to something as below: For each X from i=1 to n For each Y based on j=1 to m For each F from 1 to f Do some calculation based on Fij Store Xi,Yj = Fij End For F End for Y End for X Is there anyway to optimize the processing logic further? I *guess* using the multiple lapply
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
2006 Aug 02
1
unbalanced mixed effects models for fully factorial designs
Does anyone know of a way of dealing with unbalanced mixed effects (fixed and random factors) for fully factorial designs. An example of such data is given below; The response variable is SQRTRECRUITS SEASON is a random factor DENSITY is a fixed factor Thus DENSITY:SEASON is a fixed factor. Therefore, whereas the effects of SEASON and DENSITY:SEASON should be tested against the overall
2019 Feb 16
5
Compiz 0.9.14.0 released
Compiz 0.9.14.0 has been officially released today. Major changes in this release include: - Development has switched from Bazaar (back) to Git [1]. - CCSM has been ported to PyGObject, GTK 3 and Python 3. - compizconfig-python has been ported from Pyrex to Cython. - Restored the Color Filter plugin by porting it to the new plugin API. - Added support for loading configuration from multiple
2011 Aug 13
3
Adjacency Matrix help
I have created an adjacency matrix but have not been able to figure something out. I need to put zeros on the diagonal of the adjacency matrix. For instance, location (i,i) to equal 0. Please help. Thanks -- View this message in context: http://r.789695.n4.nabble.com/Adjacency-Matrix-help-tp3740946p3740946.html Sent from the R help mailing list archive at Nabble.com.
2010 Jul 08
2
hi... problems about adjacency matrix
Dear all, Hi, I have the problems about converting the matrix to adjacency matrix.Here's my example, a b c d e fa 1.0000000 0.4048823682 0.1228531 0.49046991 0.4945158868 0.307443317b 0.4048824 1.0000000000 0.4367475 0.96949219 0.0007378596 0.560747765c 0.1228531 0.4367474719 1.0000000 0.40037341 0.3157538204
2006 Dec 05
4
incidence and adjacency matrix conversion
Dear all, how can I convert an m x n incidence matrix into an m x m adjacency matrix or an n x n adjacency matrix? The current matrix contains binary data, hence the new matrix would contain counts of common occurrences. Thank you for your help. Phil
2013 Feb 05
2
adjacency list to non-symmetric matrix
Dear R community, is there an easy way to convert an adjacency list (or a data-frame) to a non-symmetric matrix? The adjacency list has the following form: person group 1 Sam a 2 Sam b 3 Sam c 4 Greg a 5 Tom b 6 Tom c 7 Tom d 8 Mary b 9 Mary d I need the data in a matrix with persons as rows and groups as columns: a b c d Sam 1 1 1 0 Greg 1 0 0 0 Tom 0 1 1 1 Mary 0 1 0 1 I know that there
2005 Mar 08
1
To convert an adjacency list model into a nested set model
Dear R-help I am wondering if somebody wrote some code to convert an adjacency list model into a nested set model. In principal I want to do the same as John Celko mentioned it here with SQL: http://groups.google.co.uk/groups?hl=en&lr=lang_en&selm=8j0n05%24n31%241 %40nnrp1.deja.com Assume you have a tree structure like this Albert / \ /
2008 Mar 05
4
vertex labels in igraph from adjacency matrix
I am getting some unexpected results from some functions of igraph and it is possible that I am misinterpreting the vertex numbers. Eg., the max betweenness measure seems to be from a vertex that is not connected to a single other vertex. Below if my code snippet: require(igraph) my.graph <- graph.adjacency(adjmatrix = my.adj.matrix, mode=c("undirected")) most.between.vert <-
2008 Feb 27
1
how to convert a table to adjacency matrix used in social network analysis?
Hi Guys, Do you any one know how to convert a long format table to an adjacency matrix used in sna? The long table looks like p1 p2 counts a b 100 a c 200 a d 100 b c 80 b d 90 b e 100 c d 100 c e 40 d e 60 and I want to convert it to an adjacency matrix which can be used in sna? Any methods will be appreciated! btw, besides sna package, is there any better package can be used in social
2006 Feb 18
2
Conversion to Adjacency Matrix
I have data in the following form: ID COUPON0 COUPON1 COUPON2 COUPON3 1 1 1000 1001 1002 2 2 NA NA NA 3 1000 1003 NA 1004 4 1001 NA 1005 NA 5 1002 NA NA NA 12 1003 NA NA 1006 7 1005 NA NA NA 8 1004 1007 NA NA 9 1006 NA NA NA 26
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
2009 Aug 10
4
problem selecting rows meeting a criterion
When I try to select only those rows from the following data frame, called "data", in which X > Y X Y V3 2 2 1 8.062258 3 3 1 2.236068 4 4 1 6.324555 5 5 1 5.000000 6 1 2 8.062258 8 3 2 9.486833 9 4 2 2.236068 10 5 2 5.656854 11 1 3 2.236068 12 2 3 9.486833 14 4 3 8.062258 15 5 3 5.099020 16 1 4 6.324555 17 2 4 2.236068 18 3 4 8.062258 20 5 4 5.385165 21 1 5 5.000000
2013 Mar 12
2
big edge list to adjacency matrix
I have huge list of edges with weights. a1 b1 w1 a2 b2 w2 a3 b3 w3 a1 b1 w4 a3 b1 w5 I have to convert it into 2 dim matrix b1 b2 b3 a1 max(w1,w4) 0 0 a2 0 w2 0 a3 w5 0 w3 if edges repeated take the maximum weights. How do this efficiently without using for loop? Any idea. thanks Avi [[alternative