rgexf (version 0.15.3)

rgexf Methods: S3 methods for gexf objects

Description

Methods to print and summarize gexf class objects

Usage

"print"(x, file=NA, replace=F, ...) "summary"(object, ...) "plot"(x, EdgeType = c("curve", "line"), output.dir = NULL, ...)

Arguments

x
An gexf class object.
object
An gexf class object.
file
String. Output path where to save the GEXF file.
replace
Logical. If file exists, TRUE would replace the file.
EdgeType
For the visualization
output.dir
String. The complete path where to export the sigmajs visualization
...
Ignored

Value

print.gexf
None (invisible NULL).
summary.gexf
List containing some gexf object statistics.
plot.gexf
None (invisible NULL).

Details

print.gexf displays the graph (XML) in the console. If file is not NA, a GEXF file will be exported to the indicated filepath. summay.gexf prints summary statistics and information about the graph. plot.gexf plots the graph object in the web browser using sigma-js javascript library. Generated files are stored at the OS's “temp” folder. If output.dir is not NULL, then all files required to display the graph in the web browser will be saved in the output.dir. Users must note that plot.gexf starts a server using the Rook package, otherwise it will not be possible to see the visualization (sigmajs requires this). to

References

sigmajs project website http://sigmajs.org/.

See Also

See also write.gexf

Examples

Run this code
  ## Not run: 
#     # Data frame of nodes
#     people <- data.frame(id=1:4, label=c("juan", "pedro", "matthew", "carlos"),
#                      stringsAsFactors=F)
#     
#     # Data frame of edges
#     relations <- data.frame(source=c(1,1,1,2,3,4,2,4,4), 
#                         target=c(4,2,3,3,4,2,4,1,1))
#     
#     # Building gexf graph
#     mygraph <- write.gexf(nodes=people, edges=relations)
#     
#     # Summary and pring
#     summary(mygraph)
#     
#     print(mygraph, file="mygraph.gexf", replace=T)
#     
#     # Plotting
#     plot(mygraph)
#     
#   ## End(Not run)

Run the code above in your browser using DataLab