Hello,
I am trying to compute a distance measure for the rows (var1) in a
sparse matrix:
require(Matrix)
dfx = xtabs(~ var1 + var2, data = df, sparse = T, drop.unused.levels = T
)
dm = dist(dfx)
on my data frame. Note that I am using the xtabs function from the
Matrix package, not
#
This yields:
> g4
Vertices: 4
Edges: 4
Directed: FALSE
Edges:
[0] Sam -- Greg
[1] Sam -- Tom
[2] Sam -- Mary
[3] Tom -- Mary
Which is what we wanted. I have not figured out how to weight edges yet (the
Sam and Tom edge and the Tom and Mary
t;-Original Message-
>From: Gabor Csardi [mailto:[EMAIL PROTECTED]
>Sent: Saturday, May 10, 2008 1:09 PM
>To: Messing, Solomon O.
>Cc: r-help@r-project.org
>Subject: Re: [R] For Social Network Analysis-Graph Analysis - How to
convert 2
>mode data to 1 mode data?
>
>Solo
Hi,
Does anyone know of a package in R that has a function to convert
network data (e.g. an adjacency matrix or ) from 2-mode to 1-mode? I am
conducting social network analysis. I know that Pajek has this function
under Net --> Transform --> 2-mode to 1-mode --> Rows. I have searched
the doc
4 matches
Mail list logo