Giter Site home page Giter Site logo

gvegayon / rgexf Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 5.0 4.81 MB

Create, read and write GEXF (Graph Exchange XML Format) graph files (used in Gephi and others) in R.

Home Page: https://gvegayon.github.io/rgexf

License: Other

R 39.61% HTML 2.13% JavaScript 46.48% Makefile 0.69% Python 3.83% CSS 4.58% Dockerfile 0.29% TeX 2.38%
gephi gexf gexf-graph-files rpackage r xml social-network

rgexf's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rgexf's Issues

gexf.to.igraph doesn't all passes igraph object's attributes

Originally reported by: George Vega Yon (Bitbucket: gvegayon, GitHub: gvegayon)


Must check this lines in the function

#!r

x <- list.vertex.attributes(g)
  x <- x[!(x %in% "name")]
  if (length(x)) 
    nAtt <- NULL
  else nAtt <- subset(tmpedges, select = x)
  x <- list.edge.attributes(g)
  x <- x[!(x %in% "weight")]
  if (length(x)) 
    eAtt <- NULL
  else eAtt <- subset(tmpedges, select = x)

Thanks Roberto Brunelli!


Write.gexf does not export UTF-8 characters correctly

Originally reported by: Guillem Vicens (Bitbucket: gvicens, GitHub: gvicens)


Hi George,

in R when exporting with write.gexf UTF-8 encoding for special characters (accents and the like) seem to get lost. As it seems the export is done to UTF-8 without BOM.

I have reproduced this by doing following steps:

  1. loading the graph data from 2 .CSV encoded in UTF-8 .1.
  2. Generate a graph by using the igraph package. This graph is used in my code to perform several calculations
  3. Generate the nodes and edges data frames. Up until this point all is correctly encoded in UTF-8.
  4. Use write.gexf to generate the .GEXF file. At this point encoding gets lost.

I also tried using both Encoding(x) and enc2utf8(x) with no success at all.

I have attached a minimal example to reproduce the problem. Session info is also included.

Thanks for any help!


Node and edge attributes lost in conversion to igraph

This is similar to (or the same as) the issue previously posted

When converting a gexf to igraph the node and edge attributes are not retained. Example data used from previous issue: know_network_markup3.gexf.zip

When you read the data in with read.gexf you can see the node attribute "Modularity Class" that has integer data:

gexf_net <- read.gexf(file)

head(gexf_net)
gexf_net$atts.definitions

But that attribute is not linked to the nodes dataset of the gexf object

head(gexf_net$nodes)

When gexf is converted to igraph the "Modularity Class" node attribute is lost entirely

list.vertex.attributes(igraph_net)

The example data do not have edge attributes, but the same issue exists for edge attributes as well. Would appreciate any suggestions for how to extract/retain edge and node attributes when converting gexf to igraph

RGEXF library installation problem on MAC

Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


Not available on CRAN

Originally reported by: Nathan Lapierre (Bitbucket: nlap, GitHub: nlap)


The package has been unavailable on CRAN since December. Sounds like you might realize this, but wanted to make sure.

Package ‘rgexf’ was removed from the CRAN repository.

Formerly available versions can be obtained from the archive.

Archived on 2014-12-22 as maintainer address <[email protected]> bounced. 

Attributes not included when reading in .gexf file

When reading in a gexf-file created by networkx, even though all attributes are contained in the xml-code, they are not accessible when running read.gexf and disappear completely when transform into igraph object.

Gephi sees multiple edges between nodes as parallel, even though they have different time intervals

Originally reported by: Gorkem Bostanci (Bitbucket: gorkembostanci, GitHub: gorkembostanci)


I am using Gephi version 0.82, R version 3.1.2 and rgexf version 0.14.3.11

I have created a dynamic gexf file using R-package rgexf. Gephi identifies the time format used in the gexf file. However, when I try to open it, I get the warning "Parallel edges are not supported yet..." (even when I make sure the start and end dates of edges do not coincide) and all the edge weights for different time periods are combined into the first period's edge. How can I ensure that Gephi recognizes the output from R? Here's the code I use in R

#!r

library(igraph)    
library(XML)
library(Rook)
library(rgexf)

year=2013

nodes_ini <- read.csv("network labels.csv")  
edges_ini <- read.csv("network edges dynamic3.csv")

nodes_ini <- as.matrix(nodes_ini[])
edges_ini <- as.matrix(edges_ini[])

edges <- edges_ini[,1:2]
nodes <- nodes_ini[,1:2]
edges <- data.frame(edges)
nodes <- data.frame(nodes)

edgeweight <- edges_ini[,3]
edgeweight <- as.matrix(edgeweight)
nodesatt <-nodes_ini[,3:9]
nodesatt <- as.matrix(nodesatt)
nodesize <- nodesatt[,(2014-year)]
nodesize <- as.matrix(as.numeric(nodesize))

edgetimes <- as.matrix(edges_ini[,4:5])
edgetimesdate1 <- as.Date(edgetimes[,1], "%Y-%m-%d")
edgetimesdate2 <- as.Date(edgetimes[,2], "%Y-%m-%d")
edgetimesdate11 <- data.frame(edgetimesdate1)
edgetimesdate22 <- data.frame(edgetimesdate2)
edgetimesdate <- cbind(edgetimesdate11, edgetimesdate22)



write.gexf(nodes,edges,edgesWeight = edgeweight,tFormat = "date",edgeDynamic = edgetimesdate,nodesVizAtt = list(size=nodesize),defaultedgetype="directed",output="C:/Users/gorkem/Desktop/exercise/gephi/rgexf/first3.gexf")

RGEXF library installation problem on MAC

Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


Igraph.to.gexf: Cannot export graphs containing non-connected nodes

Originally reported by: Tobias Jørgensen (Bitbucket: bornakke, GitHub: bornakke)


When trying to export an igraph object where some nodes have no edges rgexf fails in two ways:

  1. If no positions is given the graph is exported, but without the non-connected nodes.
  2. If a position is given, the following error is given:

"Error in .parseNodesVizAtt(nodesVizAtt, nodes) : Insuficient number of "nodeVizAtt" rows: The atts position (189). Every att should have the same number of rows than nodes there are (163).

I have tracked the error down to line 23 in the igraph.R file:
nodes <-merge(tmpnodes,nodes, by.x="name", by.y="label")

Here only node id extracted from the edgelist is kept. I have tried to add an all.x to the merge call, but though this probably solves the issue another error is thrown.


Wiki Example of the Dynamic GEXF file fails to open in Gephi

Originally reported by: ojvr (Bitbucket: ojvr, GitHub: Unknown)


Hi George,

I followed the examples you have in the wiki for producing a dynamic .gexf file.
The problem however, is I am unable to open it in Gephi.

#!r

library(rgexf)

people <- data.frame(matrix(c(1:4, 'juan', 'pedro', 'matthew', 'carlos'),ncol=2))
relations <- data.frame(matrix(c(1,4,1,2,1,3,2,3,3,4,4,2), ncol=2, byrow=T))
time<-matrix(c(10.0,13.0,2.0,2.0,12.0,rep(NA,3)), nrow=4, ncol=2)

write.gexf(people, relations, nodeDynamic=time)
#!xml

<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.1draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
  <meta lastmodifieddate="2014-04-29">
    <creator>NodosChile</creator>
    <description>A graph file writing in R using "rgexf"</description>
    <keywords>gexf graph, NodosChile, R, rgexf</keywords>
  </meta>
  <graph mode="dynamic" start="10" end="2" timeformat="double" defaultedgetype="undirected">
    <nodes>
      <node id="1" label="juan" start="10" end="12"/>
      <node id="2" label="pedro" start="13" end="2"/>
      <node id="3" label="matthew" start="2" end="2"/>
      <node id="4" label="carlos" start="2" end="2"/>
    </nodes>
    <edges>
      <edge id="0" source="1" target="4" weight="1"/>
      <edge id="1" source="1" target="2" weight="1"/>
      <edge id="2" source="1" target="3" weight="1"/>
      <edge id="3" source="2" target="3" weight="1"/>
      <edge id="4" source="3" target="4" weight="1"/>
      <edge id="5" source="4" target="2" weight="1"/>
    </edges>
  </graph>
</gexf>

Opening this in Gephi produces an error:

The left endpoint of the interval must be less than the right endpoint.

Have you experienced this before?
Is this a bug in Gephi or in rgexf?

Environment:

  • Gephi 0.8.2
  • rgexf 0.14.3
  • Windows 7 64-bit.
  • R 3.0.3

Error in x[2, 4] : incorrect number of dimensions

Hello,

I am trying to use read.gexf() to read a .gexf generated with the pangenomic package PPanGGOLiN (https://github.com/labgem/PPanGGOLiN) and it gets the following error:

> gephy <- read.gexf("pangenomeGraph.gexf")
Unsupported version '1.1'
Error in x[2, 4] : incorrect number of dimensions
In addition: Warning message:
In if ((x[-4] < 0) | (x[-4] > 255)) stop("The color specification is out of range.",  :
  the condition has length > 1 and only the first element will be used

Thanks for any suggestions!

Isabel

Number of decimal places for viz atts

Originally reported by: George Vega Yon (Bitbucket: gvegayon, GitHub: gvegayon)


By request of Nicolas Claidiere, rgexf needs to increase the number of decimal points allowed in viz atts (size/width). His email:


Dear George,

Thank you so much for the RGEXF package, which is extremely useful.

I have however a small problem, when I try to include small weights (e.g. 0.001), they are rounded up to 0.0 which leads to more problem with calculation of centrality, etc.

So for instance, if I try:
graph<-write.gexf(nodes=data.frame(c(1:10),c(1:10)), edges=data.frame(rep(1,9),c(2:10)), edgesWeight=c(1:9)/1000))

weights are just 0.

I have posted a question on the Gephi forum and would be very grateful if you could reply:
https://forum.gephi.org/viewtopic.php?f=29&t=3205

Thanks again for your support,
Nico


RGEXF library installation problem on MAC

Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


Reading in graph with hexadecimal colours

Hi George,
I'm trying to read in a graph with node colours specified as hexadecimals (attach is a subset of three nodes and two edges from the graph that produce the error in question).
When I try to load in the graph I get the following error:

Error in if (x < 1) stop("When specified as number, colors cannot be negative!", :
missing value where TRUE/FALSE needed
In addition: Warning message:
In check_and_map_color(as.numeric(a$color)) : NAs introduced by coercion

I have narrowed it down to the hexadecimal sting being converted to NA by the as.numeric() when calling check_and_map_color in line 58 of 'read.gexf()'. The NA is accepted as a numeric in line 4 of 'check_and_map_color', and then conflicts with the if-statement of line 5.

Is there a reason for the 'as.numeric()' function call on the colour in line 58 of 'read.gexf()' when calling 'check_and_map_color'?
I can see that 'check_and_map_color' is able to handle hexadecimal colours, as I tried to remove the 'as.numeric()' call and was able to read in the test graph provided. I hope you can clarify

Hex_col_test.txt

Cheers,
Magnus

JOSS Review

This issue contains the comments and suggestions raised by @jonjoncardoso and @corneliusfritz in openjournals/joss-reviews#3456:

  • Add a code_of_conduct.md file (ref)
  • Review the "Examples" section: Breaks (ref).
  • Improve the doc on dynamic edges.
  • Clarify the difference between spell and edge.
  • Credit where credit is due: Add both reviewers to the list of authors (😃)

read.gexf example on igraph.to.gexf man page is broken

Originally reported by: Skye Bender-deMoll (Bitbucket: skyebend, GitHub: skyebend)


I tried running some of the examples, got errors

#!r

gexf1 <- read.gexf("http://gephi.org/datasets/LesMiserables.gexf")
Unknown IO errorfailed to load external entity "http://gephi.org/datasets/LesMiserables.gexf"
Error: 1: Unknown IO error2: failed to load external entity "http://gephi.org/datasets/LesMiserables.gexf"

The xml file appears to be served correctly.

In the case below, it doesn't seem to be a correct url, perhaps a bad github redirect on the other end

#!r

gexf3 <- read.gexf("http://gexf.net/data/data.gexf")
Unknown IO errorfailed to load external entity "http://gexf.net/data/data.gexf"
Error: 1: Unknown IO error2: failed to load external entity "http://gexf.net/data/data.gexf"

edgeDynamic error for dateTime

Originally reported by: Thomas Ullmann (Bitbucket: ThomasUllmann, GitHub: ThomasUllmann)


I get the error: Error in sprintf("%.1f", edgeDynamic[, 1]) :
invalid format '%.1f'; use format %s for character objects
when executing this:
graph = write.gexf(data.frame(id = c("A","B"), name=c("A","B")), data.frame(source = "A", target="B"), nodeDynamic=data.frame(start=c("2013-10-14T02:00:30","2013-10-14T02:00:30"), end=c("2013-12-18T23:59:56","2013-12-18T23:59:56")), edgeDynamic=data.frame(start="2013-10-14T02:00:30", end="2013-12-18T23:59:56"), defaultedgetype = "directed", tFormat="dateTime" )

rgexf version 0.13.8 (R version 3.0.2 (2013-09-25) on x86_64-redhat-linux-gnu (64-bit))

Similar error but different in master (seems like the dates are getting converted to factors).


grouped nodes in gexf

Originally reported by: Unknown Name (Bitbucket: gollivier2, GitHub: Unknown)


I'm working with gexf files coming from IssueCrawler. this web crawler keep information about hyperlinks between pages. The gexf thus contains grouped sub-nodes that rgexf cannot actually manage. In fact, read.gexf works but the number of nodes in edges differs from the nodes declared in gexf.

could rgexf deal with this kind of file ?


Reboot of plotting methods

Since #29 is not closed yet, and I've been wanted to get back to this project, I've just implemented a new plotting method (last committed on 76906e2) using gexf-js (by @raphv and friends).

Finally, on the same push, I've included @raphv and @gephi Consortium as copyright holders and coauthors of the R package 😄.

@jbkunst, can you take a look at other methods for viz GEXF files?

RGEXF library installation problem on MAC

Originally reported by: George Vega Yon (Bitbucket: gvegayon, GitHub: gvegayon)


Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


RGEXF library installation problem on MAC

Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


Error plotting Wiki example 1

Originally reported by: Brian Davis (Bitbucket: brian_davis_, GitHub: Unknown)


I'm new to this so it's probably user error but when I try to plot Example 1 in the Wiki I get an error and I'm not sure how to proceed.

library(rgexf)

people <- data.frame(matrix(c(1:4, 'juan', 'pedro', 'matthew', 'carlos'),ncol=2))

relations <- data.frame(matrix(c(1,4,1,2,1,3,2,3,3,4,4,2), ncol=2, byrow=T))

g <- write.gexf(people, relations)

plot(g, EdgeType="curve")

Error in paste("http://", listenAddr, ":", listenPort, appList[[i]]$path, :
cannot coerce type 'closure' to vector of type 'character'

Am


RGEXF library installation problem on MAC

Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


Exported gexf files not compatiable with newest Sigma.js version

Originally reported by: Tobias Jørgensen (Bitbucket: bornakke, GitHub: bornakke)


I have been attempting to move my data from R to Sigma.Js through rgexf. I have tried with both print(gexf) og plot(gexf), but I cannot open any of the gexf files in Sigma afterwards. Only way to make the file open is to open it in Gephi and then export it to gexf from there.

When I compare the content of the gexf file from rgexf and the one Gephi saves there are only one difference which I can identify which is the viz informations for the nodes:

Node in Rgexf

Same node in Gephi

Is it difficult to implent so that rgexf exports these informations? A simple solution would be to to check if the gexf object contained size, position or color and if not then insert some default values?


Fatal error when exporting attributes containing a '&' sign

Originally reported by: Tobias Jørgensen (Bitbucket: bornakke, GitHub: bornakke)


Hi George,

Thanks for a so needed R extension which I'm often using.

Currently I'm however encountering an error whenever I have attributes containing an & sign.

Code to reproduce the error:

#!r

library(igraph)
library(rgexf)
g <- erdos.renyi.game(100, 1/100)

g <- set.vertex.attribute(g, "test", index=V(g), "Some & Some")
gexf <- igraph.to.gexf(g)

Error given:
xmlParseEntityRef: no name
Error: 1: xmlParseEntityRef: no name

Any suggestions to why this might happen? In the current situation I can probably just remove any &, however it took me more than an hour to identify the cause of the error which is difficult to guess based on the error message.

Best regards
Tobias


gexf.to.igraph fails when igraph has weights

Originally reported by: George Vega Yon (Bitbucket: gvegayon, GitHub: gvegayon)


Must conver the edges to numbers before passing them to write.gexf

#!r
> gexf.to.igraph(grafo)
IGRAPH UNW- 4 9 -- 
+ attr: name (v/c), label (v/c), att1 (v/c), att2 (v/x), color (v/c), id (e/n),
  weight (e/c), att1 (e/x), edgesLabel (e/n), color (e/c)
> igraph.to.gexf(gexf.to.igraph(grafo))
Error in sprintf("%.1f", edges$x) : 
  invalid format '%.1f'; use format %s for character objects


RGEXF library installation problem on MAC

Hello George,

Sorry to bother you for this, but I have issues while installing your library RGEXF on a MAC OS X.
I have tried on Windows at it works but for MAC I got this issue:

install.packages("/Users/diegolopezpozueta/Downloads/rgexf_0.12.03.29.tar.gz", repos = NULL)
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
library(rgexf)
Error en library(rgexf) : ‘rgexf’ is not a valid installed package

I tried in RSTUDIO and also in R.

But then I go to the Folder /Library/Frameworks/R.framework/Versions/2.14/Resources/library and it exist a folder rgexf but I cannot load the library and it does not appear on RSTUDIO under packages (see pictures)

I was wondering if you may know how to solve this issue...Thanks for your time.

Regards,
Diego López Pozueta.
about.me/diegolopezpozueta


Labels do not show in output file

Originally reported by: Tim Smith (Bitbucket: tsmith314, GitHub: Unknown)


Maybe I'm missing something, but the following code does not produce an output with the proper labels (and, also, an error)

...r code...
people <- data.frame(c(1:4), c('juan', 'pedro', 'matthew', 'carlos'))
relations <- data.frame(source=c(1,1,1,1), target=c(2,3,4,2))
write.gexf(nodes=people, edges=relations)

..gexf output

NodosChile A graph file writing in R using "rgexf" gexf graph, NodosChile, R, rgexf Warning message: In `[<-.data.frame`(`*tmp*`, , tofix, value = list(2, 4, 3, 1)) : provided 4 variables to replace 1 variables

Sigma exporter appears brokken

Originally reported by: Tobias Jørgensen (Bitbucket: bornakke, GitHub: bornakke)


I'm trying to export a igraph object to sigma through rgexf however instead of a graph I get the following output in the browser:

#!html

"Only NEWS and URLs under /doc and /library are allowed "

I have tried to debug the error which seem related to the loading of the js files, but pointing to other js files just triggers a bunch of other errors which is beyond my capabilities to understand.

PS: another small error is at the wiki which states that the latest version in cran is 0.14.9. while Rstudio says that it is 0.14.3.11. Not the worlds biggest problem, but I did spent 15 min. trying to uncover if I were using a old version of Rgexf.


igraph.to.gexf error with edge attributes

I've run into a reversion caused by changes in 39d2440. When a graph (igraph) contains non-standard edge attributes, it cannot be converted to gexf. E.g. try running the example below:

df <- data.frame(from=c(1, 1, 2),
                 to=c(2, 3, 3),
                 flavor=c('yum', 'yum', 'yuck'))

g <- igraph::graph_from_data_frame(df)
gexf <- rgexf::igraph.to.gexf(g)

The apparent offending lines are below, which appear to drop all edge attributes from edges and then attempt to subset named attributes out of edges, which only fails if those attributes exist in the original graph.

rgexf/R/igraph.R

Lines 58 to 60 in dd222bf

edges$source <- rownames(nodes)[match(edges$from, rownames(nodes))]
edges$target <- rownames(nodes)[match(edges$to, rownames(nodes))]
edges <- edges[, c('source', 'target')]

rgexf/R/igraph.R

Lines 69 to 72 in dd222bf

x <- igraph::list.edge.attributes(g)
x <- x[!(x %in% c("weight","color","edgesLabel","width"))]
if (length(x))
dots$edgesAtt <- subset(edges, select=x)

From skimming the code, this seems to have been caused by a change from relying on a tmpedges copy of edges for the subsetting to using edges itself. I haven't spent enough time on the code here to figure out why dropping the tmpedges copy was necessary or what a fix might be.

Sigma exporter appears brokken

Originally reported by: Tobias Jørgensen (Bitbucket: bornakke, GitHub: bornakke)


I'm trying to export a igraph object to sigma through rgexf however instead of a graph I get the following output in the browser:

#!html

"Only NEWS and URLs under /doc and /library are allowed "

I have tried to debug the error which seem related to the loading of the js files, but pointing to other js files just triggers a bunch of other errors which is beyond my capabilities to understand.

PS: another small error is at the wiki which states that the latest version in cran is 0.14.9. while Rstudio says that it is 0.14.3.11. Not the worlds biggest problem, but I did spent 15 min. trying to uncover if I were using a old version of Rgexf.


XML parsing error

I'm trying to build gexf graph files from {rtweet} dataframes. I've created node and edge data.frames that should satisfy requirements for write.gexf, but get the following parsing error:

Error: 1: error parsing attribute name 2: attributes construct error 3: Couldn't find end of Start Tag node line 1 4: Opening and ending tag mismatch: tmp line 1 and node 5: Extra content at the end of the document

I really don't know what the issue is (XML isn't one of my skills). I've tried to sanitize the XML for nodes as well as source and target in the edges df, but to no avail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.