gexf-methods: S3 methods for 'gexf' objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Methods to print and summarize gexf class objects

Usage

1
2
3
4
5
## S3 method for class 'gexf'
print(x, file = NA, replace = F, ...)

## S3 method for class 'gexf'
summary(object, ...)

Arguments

x

An gexf class object.

file

String. Output path where to save the GEXF file.

replace

Logical. If file exists, TRUE would replace the file.

...

Ignored

object

An gexf class object.

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.

Value

list("print.gexf")

None (invisible NULL).

list("summary.gexf")

List containing some gexf object statistics.

Author(s)

George G. Vega Yon

Joshua B. Kunst

See Also

See also write.gexf, plot.gexf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  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)
    
  }

gvegayon/rgexf documentation built on Oct. 25, 2021, 4:21 p.m.