Use a list instead, for the output in the "for" loop.
On Thu, Nov 27, 2014 at 6:09 PM, patricia <[email protected]> wrote:
> Hello,
>
> Please explain to me how to do the following:
>
> communities <- infomap.community (g)
> n_communities <- sizes (communities)
>
> I want to create a repeating loop using R, which varies from 1 to sizes
> (communities) and assign the vertices contained in the community consulted
> the array named MatrixOfCommunities. I used the code below, but got the
> following error message:
>
> for (lines in 1: n_communities)
> {
> MatrixOfCommunities [lines, ] <- V (g) [membership
> (communities) == lines] $ "label1";
> }
>
> number of items to replace is not a multiple of replacement length
> In addition: Warning message:
> In 1: n_comunidades:
> numerical expression has 82 elements: only the first used
>
>
> Thank you
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help