[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Error while using edgelist function
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Error while using edgelist function |
Date: |
Mon, 23 Mar 2009 08:06:37 +0100 |
Anupam,
the first argument of graph.edgelist should be an R matrix object, not
a filename. Use the normal R commands to read in your data first, and
then call graph.edgelist.
E.g.
edgelist <- read.table("<filename>", header=TRUE)
g <- graph.edgelist(as.matrix(edgelist))
See ?read.table and ?graph.edgelist for details. If your have large
files, then scan() will be faster than read.table, see ?scan.
Best,
Gabor
2009/3/23 anupam sinha <address@hidden>:
> Dear all,
>
> While using the graph.edgelist funtion I give a file as the
> input. This file contains the edgelist representation of the metabolic
> network of yeast. The following is the kind of input I am giving and the
> error I am getting :
>
> Source_node Destination_node
> Q0045 Q0045
> Q0045 Q0250
> Q0045 Q0275
> Q0045 YDL067C
> Q0045 YGL187C
> Q0045 YGL191W
> Q0045 YHR051W
> Q0045 YIL111W
> Q0045 YLR038C
>
>
>
> g<-graph.edgelist("/home/anupam/Desktop/network_analysis/gerstein_C-programs_network/met_network_yeast.txt",
> directed =FALSE)
> Error in
> graph.edgelist("/home/anupam/Desktop/network_analysis/gerstein_C-programs_network/met_network_yeast.txt",
> :
> graph.edgelist expects a matrix with two columns
>
>
> Can anyone help me with this??? Thanks in advance.
>
>
> Regards,
>
> Anupam Sinha
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
--
Gabor Csardi <address@hidden> UNIL DGM