On Wed, Aug 8, 2012 at 1:14 PM, jameson mcfarlane <[email protected]> wrote:
> G, thank you. Here is the code:
>
>        library(igraph)
>        D <- read.csv("New Jam.csv")
>        D <- D[,-1]
>        G <- graph.adjacency(as.matrix(D), weighted=TRUE)

D is not an adjacency matrix. graph.adjacency() works with adjacency
matrices. You need to convert your data to an adjacency matrix, or
construct the graph in a different way.

Gabor

>
>       V(G)$label <- V(G)$name
>       V(G)$shape <- "rectangle"
>       V(G)$color <- "white"
>       V(G)$size <- 40
>
>       mst <- minimum.spanning.tree(G)
>       lay <- layout.reingold.tilford(G, mode="all")
>      plot(mst, layout=lay)
>
>
> Thanks again
>> Date: Wed, 8 Aug 2012 13:07:58 -0400
>> From: [email protected]
>> To: [email protected]
>> Subject: Re: [igraph] Square Matrix /MST
>
>>
>> Hi, I am not sure how you are converting your data file into an igraph
>> graph, probably you are trying to call graph.adjacency, and the data
>> file is clearly not an adajacency matrix.
>>
>> Please show us your code and we will tell you what is wrong.
>>
>> G.
>>
>> On Wed, Aug 8, 2012 at 12:58 PM, jameson mcfarlane
>> <[email protected]> wrote:
>> > Hello Everyone,
>> > I'm rather new to igraph. I am using Windows 7 to create an MST
>> > (Minimum Spanning Tree) with the attached data file. However, I keep
>> > getting
>> > that this data is not a square matrix. Any kind of help will be much
>> > appreciated.
>> >
>> > Thank you,
>> > Jameson
>> >
>> > _______________________________________________
>> > igraph-help mailing list
>> > [email protected]
>> > https://lists.nongnu.org/mailman/listinfo/igraph-help
>> >
>>
>>
>>
>> --
>> Gabor Csardi <[email protected]> MTA KFKI RMKI
>>
>> _______________________________________________
>> igraph-help mailing list
>> [email protected]
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <[email protected]>     MTA KFKI RMKI

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to