Methods to print and summarize gexf class objects
Arguments
- x
An
gexfclass object.- file
String. Output path where to save the GEXF file.
- replace
Logical. If
fileexists,TRUEwould replace the file.- nnodes
Integer. Maximum number of nodes to print (default 10).
- nedges
Integer. Maximum number of edges to print (default 10).
- ...
Ignored
- object
An
gexfclass object.
Value
- list("print.gexf")
None (invisible
NULL).- list("summary.gexf")
List containing some
gexfobject statistics.
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.
See also
See also write.gexf, plot.gexf
Examples
if (interactive()) {
# 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 <- gexf(nodes=people, edges=relations)
# Summary and pring
summary(mygraph)
write.gexf(mygraph, output="mygraph.gexf", replace=TRUE)
# Plotting
plot(mygraph)
}