[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] author lists to network
From: |
Simone Gabbriellini |
Subject: |
Re: [igraph] author lists to network |
Date: |
Thu, 10 Mar 2011 10:26:01 +0100 |
you can check also graph.data.frame:
Description
This function creates an igraph graph from one or two data frames containing
the (symbolic) edge list and edge/vertex attributes.
Usage
graph.data.frame(d, directed=TRUE, vertices=NULL)
Arguments
d A data frame containing a symbolic edge list in the first two columns.
Additional columns are considered as edge attributes.
directed Logical scalar, whether or not to create a directed graph.
vertices A data frame with vertex metadata, or NULL. See details below.
HTH,
Simone
Il giorno 10/mar/2011, alle ore 01.31, Alex D'Amour ha scritto:
> Stuart,
>
> The best way to do this is to first construct a list that maps author
> to paper. You should do this in a dataframe with columns Paper and
> Author:
>
> Paper, Author
> Paper1, John
> Paper1, Mary
> Paper1, Sam
> Paper2, Roger
> etc...
>
> Then you can use the merge command in R to merge this dataframe with itself:
>
> df2 <- merge(df, df, by="Paper")
>
> This will give you a dataframe like the one that you want. You will
> probably want to filter out the self loops:
>
> df3 <- df2[df2$author.x != df2$author.y,]
>
> This should get you what you're looking for.
>
> HTH,
> Alex
>
> On Wed, Mar 9, 2011 at 7:10 PM, Stuart Kininmonth
> <address@hidden> wrote:
>> Hi Networkers,
>>
>>
>>
>> Just trying to take a large list of authors who have worked on papers and
>> turn into network in R igraph.
>>
>> So input looks like (simplified but can be any number of authors per paper):
>>
>> Paper1, John, Mary, Sam
>>
>> Paper 2, John, Roger, Trevor, Sue, Peter
>>
>> Etc…
>>
>>
>>
>> I need to make it a pair wise list (or alternative for igraph input) for
>> each row so looking like this:
>>
>> John, Mary
>>
>> John, Sam
>>
>> Mary, Sam
>>
>> John, Roger
>>
>> John, Trevor
>>
>> John, Sue
>>
>> John, Peter
>>
>> Roger, Trevor
>>
>> Roger, sue
>>
>> Roger, peter,
>>
>> Trevor, sue
>>
>> Trevor, peter
>>
>> Sue, peter
>>
>> Etc…
>>
>>
>>
>> Any suggestions welcomed.
>>
>>
>>
>> cheers
>>
>>
>>
>>
>>
>> Stuart Kininmonth
>>
>> Spatial Ecologist
>>
>> Australian Institute of Marine Science
>>
>> PMB #3, Townsville, Qld, 4819 Australia
>>
>> w: 61 7 47534334
>>
>> m: 0439 673 546
>>
>>
>>
>> “It is the set of the sails, not the direction of the wind that determines
>> which way we will go.” Jim Rohn
>>
>>
>>
>>
>>
>> --
>> ------------------------------------------------------------------------
>> The information contained within this transmission is for the
>> use of the intended recipient only and may contain confidential
>> and/or legally privileged material and/or material the subject
>> of copyright and/or personal information and/or sensitive
>> information that is subject to the Privacy Act 1988. Any review,
>> re-transmission, disclosure, dissemination or other use of, or
>> taking of any action in reliance upon, this information by
>> persons or entities other than the intended recipient is
>> prohibited. If you have received this email in error please
>> notify the AIMS Privacy Officer on (07) 4753 4444 and delete
>> all copies of this transmission together with any attachments.
>> ------------------------------------------------------------------------
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help