igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Square Matrix /MST


From: Gábor Csárdi
Subject: Re: [igraph] Square Matrix /MST
Date: Wed, 8 Aug 2012 16:49:51 -0400

On Wed, Aug 8, 2012 at 1:14 PM, jameson mcfarlane <address@hidden> 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: address@hidden
>> To: address@hidden
>> 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
>> <address@hidden> 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
>> > address@hidden
>> > https://lists.nongnu.org/mailman/listinfo/igraph-help
>> >
>>
>>
>>
>> --
>> Gabor Csardi <address@hidden> MTA KFKI RMKI
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     MTA KFKI RMKI



reply via email to

[Prev in Thread] Current Thread [Next in Thread]