Displaying 20 results from an estimated 4000 matches similar to: "incidence and adjacency matrix conversion"
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
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
2011 Sep 25
4
Trouble creating and adjacency matrix
Hello all,
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,]
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
2007 Feb 13
4
isoMDS vs. other non-metric non-R routines
Dear useRs,
last week I asked you about a problem related to isoMDS. It turned
out that in my case isoMDS was trapped. Nonetheless, I still have
some problems with other data sets. Therefore I would like to know if
anyone here has experience with how well isoMDS performs in
comparison to other non-metric MDS routines, like Minissa.
I have the feeling that for large data sets with a high
2015 Mar 19
6
RFC: Matrix package: Matrix products (%*%, crossprod, tcrossprod) involving "nsparseMatrix" aka sparse pattern matrices
This is a Request For Comment, also BCCed to 390 package maintainers
of reverse dependencies of the Matrix package.
Most users and package authors working with our 'Matrix' package will
be using it for numerical computations, and so will be using
"dMatrix" (d : double precision) matrix objects M, and indirectly, e.g., for
M >= c will also use "lMatrix" (l:
2012 Nov 19
0
R SNA: Creating a adjacency matrix containing all actors but only values of a subset
1 down vote favorite
my problem is the following:
I am using the R SNA package for social network analysis. Lets say, my
starting point is an edgelist with the following characteristics. Every row
contains a firm name, the ID of a project they are involved and further
characteristics, let's say the projects year. Firms can be in several
projects, and one project can consist of a
2003 Oct 22
4
adjacency matrix
Dear R experts,
I am new to the list and R software. I need to convert arcview file to Winbugs having R has middle package. Got from friends that it is possible following the steps:
1. Converting arcview shapefile to "cgm clear text file"
2. Downloading "convert.r" to into R
2.1 use source("convert.r")
2.2 convert("filename_cgm") without the
2007 Jul 05
1
Incidence estimated from Kaplan-Meier
Dear all,
I have a stat question that may not be related to R, but I would like to
have your advice.
I have just read a medical paper in which the authors report the 1-p (where
p is the cumulative survival probability from the Kaplan Meier curve) as
incidence of disease.
Specifically, the study followed ~12000 women on drug A and ~20000 women on
drug B for 12 months. During that period
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
2006 Oct 24
3
Help with understanding [[]] [] array, list, matrix referencing
Hi all,
I would greatly appreciate some help understanding how R references
arrays, matrices, lists, and objects using [[]] and []. I have read the
R guides and several tutorials but I am not the fastest kid on the block
so I am still having difficulty understanding this. For examples the
following code produces a 5 element list of 2X5 random numbers that I
then convert to a 2X5X5 matrix.
2007 Apr 15
0
correlation between multiple adjacency matrix graphs
I'm looking for a way to do (product moment) graph correlation
between multiple unlabeled graphs G to Gn. Basically I have 900
individual samples of a 48x48 adjacency matrix which I've listed as a
3rd dimension of a single array. So it looks something like [48,48,i]
where i is each individual subject's adjacency matrix.
If i run the gcor function on any two graphs for example
2012 Jun 27
1
trend in incidence rate
I would like to compare the incidence rates of three groups. They are
supposed to have different risks so I would like to test whether there is a
increasing trend in the incidence rates. Does R or any packages provide a
trend test for incidence rates? I checked epiR and epitools. It seems they
do not have this function.
Thank you for the help.
--
View this message in context:
2009 Nov 16
2
parsing Google search results
Hi,
how can I parse Google search results? The following code returns
"integer(0)" instead of "1" although the results of the query clearly
contain the regex "cran".
####
address <- url("http://www.google.com/search?q=cran")
open(address)
lines <- readLines(address)
grep("cran", lines[3])
####
Thanks
Philip
--
Philip Leifeld
Max
2013 Feb 05
1
Calculating Cumulative Incidence Function
Hello,
I have a problem regarding calculation of Cumulative Incidence Function.
The event of interest is failure of bone-marrow transplantation, which may
occur due to relapse or death in remission. The data set that I have
consists of- lifetime variable, two indicator variables-one for relapse and
one for death in remission, and the other variables are donor type (having
3 categories), disease
2011 Jun 27
7
cumulative incidence plot vs survival plot
Hi, I am wondering if anyone can explain to me if cumulative incidence (CI) is
just "1 minus kaplan-Meier survival"? Under what circumstance, you should use
cumulative incidence vs KM survival? If the relationship is just CI =
1-survival, then what difference it makes to use one vs. the other?
And in R how I can draw a cumulative incidence plot. I know I can make a
Kaplan-Meier