[R-sig-networks] [R] data network format and grouping analysis

Sebastián Daza sebastian.daza at gmail.com
Wed May 18 23:50:36 CEST 2011


Thank you Mathijs, but now I have several graphs with loops that don't 
mean anything. Isn't there another way to do it? Do you know about some 
clear document that deals with these kind of data management problems in 
R and sna?

Sebastian

On 5/18/2011 2:48 PM, Mathijs de Vaan wrote:
> Simply add an edge between ego and ego for each ego.
>
> Mathijs
>
> 2011/5/18 Sebastián Daza <sebastian.daza at gmail.com
> <mailto:sebastian.daza at gmail.com>>
>
>     Thank you Scott.
>     NA means there is no edge.  If I exclude NAs, I could lose isolated
>     individuals. That's why my question. Each ego selected three friends
>     in my database. If an ego didn't select any friend, it had only NAs
>     in alter column. Any ideas?
>
>
>     On 5/18/2011 2:33 PM, Scott Chamberlain wrote:
>
>         The following works to get an igraph object from a matrix edgelist:
>
>         dat2 <- matrix(rep(seq(1,5,1), 4), nrow=10, ncol=2)
>         graph.edgelist( dat2 )
>
>
>         I tried with NA's but graph.edgelist did not allow NA's.
>         Wouldn't you
>         just leave those rows out with NA's in them? An NA means there is no
>         edge, right?
>
>         Scott
>
>         On Wednesday, May 18, 2011 at 1:23 PM, Sebastián Daza wrote:
>
>             Hi everyone,
>             I have a dataset of friendship with this format:
>
>             ego alter
>             4746 1 2
>             9742 1 3
>             14738 1 NA
>             4747 2 NA
>             9743 2 3
>             14739 2 1
>             4748 3 13
>             9744 3 5
>             14740 3 14
>             4749 4 NA
>             9745 4 NA
>             14741 4 NA
>             4750 5 NA
>             9746 5 13
>             14742 5 10
>             4751 6 12
>             9747 6 7
>             ...
>
>
>             NA means that individuals don't select any friend. DDoes
>             anyone know how
>             to format this dataset to use sna or igraph packages? I
>             don't know how
>             to convert it into a matrix or a edgelist in R without
>             losing isolated
>             individuals .
>
>             Next question, anyone knows if there is a package to perform
>             a Moody's
>             Crowds routine to identify groups using R, or other
>             algorithms designed
>             to search groups by maximizing modularity scores?
>
>             Thank you in advance!
>
>             --
>             Sebastián Daza
>             sebastian.daza at gmail.com <mailto:sebastian.daza at gmail.com>
>             <mailto:sebastian.daza at gmail.com
>             <mailto:sebastian.daza at gmail.com>>
>
>             ______________________________________________
>             R-help at r-project.org <mailto:R-help at r-project.org>
>             <mailto:R-help at r-project.org <mailto:R-help at r-project.org>>
>             mailing list
>             https://stat.ethz.ch/mailman/listinfo/r-help
>             PLEASE do read the posting guide
>             http://www.R-project.org/posting-guide.html
>             and provide commented, minimal, self-contained, reproducible
>             code.
>
>
>
>     --
>     Sebastián Daza
>     sebastian.daza at gmail.com <mailto:sebastian.daza at gmail.com>
>
>     _______________________________________________
>     R-sig-networks mailing list
>     R-sig-networks at r-project.org <mailto:R-sig-networks at r-project.org>
>     https://stat.ethz.ch/mailman/listinfo/r-sig-networks
>
>

-- 
Sebastián Daza
sebastian.daza at gmail.com



More information about the R-sig-networks mailing list