R: S3 methods for 'gexf' objects

rgexf Methods {rgexf} | R Documentation

## S3 methods for `gexf` objects

### Description

Methods to print and summarize `gexf` class objects

### Usage

      ## S3 method for class 'gexf'
    print(x, file=NA, replace=F, ...)
      ## S3 method for class 'gexf'
    summary(object, ...)
      ## S3 method for class 'gexf'
    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

### 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

### Value

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

### Author(s)

George Vega Yon george.vega@nodoschile.org,

Joshua B. Kunst jbkunst@nodoschile.org

### References

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

### See Also

See also `write.gexf`

### Examples

      ## 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)

[Package rgexf version 0.15.3 Index]