On Thu, May 22, 2008 at 01:45:32AM +1000, Szabolcs Feczak wrote:
> Hi,
>
> I have just started to use this tool with R, so far I have achieved
> to read my adjacency matrix from CVS and plot the graph (with the method
> below),
> however I would like to have the vertex labels as the identifiers
> on the rows/columns not the automatically assigned numbers
> how can I do this automatically (I have more actors, the below is just a
> truncated file)
>
>
>
> Thanks
>
> S.
>
> ps: great tool
> -------------------
>
>
> > read.csv(file="out8.csv",head=TRUE,row.names=1,check.names = FALSE)
> 123827 375857 530241 547613 661825 771302
> 123827 0 1 0 0 0 1
> 375857 1 0 0 0 0 1
> 530241 0 0 0 0 1 0
> 547613 0 0 0 0 0 1
> 661825 0 0 1 0 0 0
> 771302 1 1 0 1 0 0
> > graph.adjacency(read.csv(file="out8.csv",head=TRUE,row.names=1,check.names =
> FALSE))
> Vertices: 6
> Edges: 10
> Directed: TRUE
> Edges:
>
> [0] 0 -> 1
> [1] 0 -> 5
> [2] 1 -> 0
> [3] 1 -> 5
> [4] 2 -> 4
> [5] 3 -> 5
> [6] 4 -> 2
> [7] 5 -> 0
> [8] 5 -> 1
> [9] 5 -> 3
> > g8 <- graph.adjacency(read.csv(file="out8.csv",head=TRUE,row.names=
> 1,check.names = FALSE))
> > tkplot(g8, layout=layout.fruchterman.reingold, vertex.size=12, vertex.label=V
> (g8)$name)
> _______________________________________________