Hello, Just set the attribute,
V(g)$date <- as.POSIXct(as.POSIXlt(rep(315522000, 6), origin="1970-01-01")) V(g)$date Rui Barradas Em 30-06-2012 04:26, HIMANSHU MITTAL escreveu:
Thanks a lot. But i have one more doubt one of the attribute i have is time of edge formation id1,id2,label,time 51,66,0,315522000 51,66,0,315522000 140,157,0,315522000 140,173,0,415522000 so is there any attribute for storing timestamps like for weight or color or if i store it in color would i lose the information? On Sat, Jun 30, 2012 at 2:56 AM, Rui Barradas <ruipbarra...@sapo.pt <mailto:ruipbarra...@sapo.pt>> wrote: Hello, Package igraph can create graphs. Example: dat <- read.table(text=" node1 node2 attr1 attr2 2 1 2 3 3 2 3 2 4 3 4 2 6 5 1 4 ", header=TRUE) dat vertices <- as.vector( t(dat[, 1:2]) ) g <- graph(vertices, directed=FALSE) E(g)$weight <- dat$attr1 E(g)$color <- dat$attr2 plot(g, layout=layout.circle, edge.label=E(g)$weight, edge.color=E(g)$color) Also, you should post data examples like the posting guide says. With your description, a small example like the one above would do. Hope this helps, Rui Barradas Em 29-06-2012 19:05, HIMANSHU MITTAL escreveu: yes i would prefer igraph, but it can be any r package as long as it can create the graph On Fri, Jun 29, 2012 at 11:14 PM, Peter Ehlers <ehl...@ucalgary.ca <mailto:ehl...@ucalgary.ca>> wrote: On 2012-06-29 10:28, HIMANSHU MITTAL wrote: Hi all, I have a text file in which the graph info is stored as: node1 node2 attr1 attr2 where there is an edge b/w node1&2 and attr1&2 are edge atttributes is there any way to create a graph using such format in r? The igraph package? Peter Ehlers Regards, Himanshu Mittal [[alternative HTML version deleted]] ________________________________**________________ R-help@r-project.org <mailto:R-help@r-project.org> mailing list https://stat.ethz.ch/mailman/*__*listinfo/r-help <https://stat.ethz.ch/mailman/**listinfo/r-help><https://stat.__ethz.ch/mailman/listinfo/r-__help <https://stat.ethz.ch/mailman/listinfo/r-help>> PLEASE do read the posting guide http://www.R-project.org/** posting-guide.html <http://www.R-project.org/__posting-guide.html <http://www.R-project.org/posting-guide.html>> and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ________________________________________________ R-help@r-project.org <mailto:R-help@r-project.org> mailing list https://stat.ethz.ch/mailman/__listinfo/r-help <https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/__posting-guide.html <http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help@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.