[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Boolean attributes in graphml
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Boolean attributes in graphml |
Date: |
Fri, 15 Nov 2013 13:49:20 -0500 |
Hi Frederik,
thanks for the report! This was fixed already in the dev tree, will be
released soon:
g <- graph.ring(10)
V(g)$type <- sample(c(TRUE, FALSE), vcount(g), rep=TRUE)
write.graph(g, format="graphml", file="/tmp/a.graphml")
g2 <- read.graph("/tmp/a.graphml", format="graphml")
g2
# IGRAPH U--B 10 10 -- Ring graph
# + attr: name (g/c), mutual (g/l), circular (g/l), type (v/l), id (v/c)
V(g2)$type
# [1] TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE
Gabor
On Fri, Nov 15, 2013 at 1:44 PM, Frederik Elwert <address@hidden> wrote:
> Hello,
>
> I want to import a graphml file into igraph. The file has a boolean
> attribute:
>
> <key id="type" for="node" attr.name="type" attr.type="boolean"/>
>
> The attribute is written like this:
>
> <data key="type">false</data>
>
> Gephi loads this fine, but igraph fails to load this attribute as bool.
> (In python, it becomes a float with the value 0.0, regardless if it is
> 'true' or 'false'.)
>
> I looked how igraph saves boolean values, but it looks like it saves
> them as 'double', not as 'boolean'.
>
> Is it possible to load boolean values from graphml files into igraph?
>
> Regards
> Frederik
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help