

hi
  thanks for your reply. there are around 20000 nodes in my dataset. will it work for conversion from edge list format to node list format? I am using R under Windows XP.

With Warm Wishes and Regards
                                              ____
A. Abdul Rasheed, M.C.A., M.E., Ph.D.,
Assistant Professor,
Department of Computer Applications,
Valliammai Engineering College,
SRM Nagar, Kattankulathur - 603 203.
Kancheepuram District. Tamil Nadu. INDIA.
Contact: 91 - 44 - 27454784 Ext: 451 (O) / 996 23 000 55





Date: Fri, 10 Dec 2010 10:33:30 -0800
From: ml-node+3082496-762697967-204682@n4.nabble.com
To: profaar@live.com
Subject: Re: help requested



	On Fri, Dec 10, 2010 at 07:20:55AM -0800, profaar wrote:

> 

> HI friends,

>   I have very lengthy graph data in edge list format. I want to convert it

> into node list format. 

> 

> example:

> EDGE LIST FORMAT

> 1 2 

> 1 3 

> 1 4 

> 1 5

> 2 3 

> 2 4

> 3 2 

> 4 1

> 4 3

> 4  5

> 5 2

> 5 4

> 

> ITS NODE LIST FORMAT SHOULD BE LIKE:

> 1 2 3  4 5

> 2 3 4

> 3 2

> 4 1 3

> 5 2 4

> 

>   Kindly suggest me which package in R provides the support to do my task.

How long the list of egdes is? For not too large lists, consider also


  library(graph)

  G <- new("graphNEL", edgemode="directed")

  G <- addNode(as.character(1:5), G)

  edges <- read.table(file=stdin(), colClasses="character")

1 2

1 3

1 4

1 5

2 3

2 4

3 2

4 1

4 3

4 5

5 2

5 4


  G <- addEdge(from=edges[, 1], to=edges[, 2], G)

  edgeL(G)


  $`1`

  $`1`$edges

  [1] 2 3 4 5

  

  

  $`2`

  $`2`$edges

  [1] 3 4

  

  

  $`3`

  $`3`$edges

  [1] 2

  

  

  $`4`

  $`4`$edges

  [1] 1 3 5

  

  

  $`5`

  $`5`$edges

  [1] 2 4


Very large lists can be handled by unix/linux sort command (if not sorted

already) and by extracting the end-nodes of the edges starting in each node.

In a sorted file, they form blocks of consecutive lines, so a simple text

processing with perl is sufficient.


Petr Savicky.


______________________________________________

[hidden email] 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.


	

	

	
	
		View message @ http://r.789695.n4.nabble.com/help-requested-tp3082147p3082496.html

		
		To unsubscribe from help requested, click here.
	 		 	   		  
-- 
View this message in context: http://r.789695.n4.nabble.com/help-requested-tp3082147p3083278.html
Sent from the R help mailing list archive at Nabble.com.

	[[alternative HTML version deleted]]

