Builds a graph of
write.gexf takes a
node matrix (or dataframe) and an
edge matrix (or dataframe) and creates a
gexf object containing a data-frame representation and a gexf representation of a graph.
write.gexf( nodes, edges, edgesLabel = NULL, edgesId = NULL, edgesAtt = NULL, edgesWeight = NULL, edgesVizAtt = list( color=NULL, size=NULL, shape=NULL ), nodesAtt = NULL, nodesVizAtt = list( color=NULL, position=NULL, size=NULL, shape=NULL, image=NULL ), nodeDynamic = NULL, edgeDynamic = NULL, digits = getOption("digits"), output = NA, tFormat = "double", defaultedgetype = "undirected", meta = list( creator="NodosChile", description="A graph file writing in R using \"rgexf\"", keywords="gexf graph, NodosChile, R, rgexf"), keepFactors = FALSE, encoding = "UTF-8" )
- A two-column data-frame or matrix of ids and labels representing nodes.
- A two-column data-frame or matrix containing source and target for each edge. Source and target values are based on the nodes ids.
- A one-column data-frame, matrix or vector.
- A one-column data-frame, matrix or vector.
- A data-frame with one or more columns representing edges' attributes.
- A numeric vector containing edges' weights.
- List of three or less viz attributes such as color, size (thickness) and shape of the edges (see details)
- A data-frame with one or more columns representing nodes' attributes
- List of four or less viz attributes such as color, position, size and shape of the nodes (see details)
- A two-column matrix or data-frame. The first column indicates the time at which a given node starts; the second one shows when it ends. The matrix or data-frame must have the same number of rows than the number of nodes in the graph.
- A two-column matrix or data-frame. The fist column indicates the time at which a given edge stars; the second one shows when it ends. The matrix or dataframe must have the same number of rows than the number of edges in the graph.
- Integer. Number of decimals to keep for nodes/edges sizes. See
- String. The complete path (including filename) where to export the graph as a GEXF file.
- String. Time format for dynamic graphs (see details)
- directed, undirected, mutual
- A List. Meta data describing the graph
- Logical, whether to handle factors as numeric values (
TRUE) or as strings (
FALSE) by using
- Encoding of the graph.
edgesAtt must have the same number of rows as nodes and edges, respectively. Using data frames is necessary as in this way data types are preserved.
edgesVizAtt allow using visual attributes such as color, position (nodes only), size (nodes only), thickness (edges only) shape and image (nodes only).
- Color is defined by the RGBA color model, thus for every node/edge the color should be specified through a data-frame with columns r (red), g (green), b (blue) with integers between 0 and 256 and a last column with alpha values as a float between 0.0 and 1.0.
- Position, for every node, it is a three-column data-frame including x, y and z coordinates. The three components must be float.
- Size as a numeric colvector (float values).
- Thickness (see size).
- Node Shape (string), currently unsupported by Gephi, can take the values of disk, square, triangle, diamond and image.
- Edge Shape (string), currently unsuported by Gephi, can take the values of solid, dotted, dashed and double.
- Image (string), currently unsupported by Gephi, consists on a vector of strings representing URIs.
edgeDynamicallow to draw dynamic graphs. It should contain two columns start and end, both allowing
NAvalue. It can be use jointly with
tFormatwhich by default is setted as double. Currently accepted time formats are:
- Integer or double.
- International standard date yyyy-mm-dd.
- dateTime W3 XSD (http://www.w3.org/TR/xmlschema-2/#dateTime).
meta: (list) Meta data describing the graph.
mode: (list) Sets the default edge type and the graph mode.
atts.definitions: (list) Two data-frames describing nodes and edges attributes.
nodesVizAtt: (data-frame) A multi-column data-frame with the nodes' visual attributes.
edgesVizAtt: (data-frame) A multi-column data-frame with the edges' visual attributes.
nodes: (data-frame) A two-column data-frame with nodes' ids and labels.
edges: (data-frame) A five-column data-frame with edges' ids, labels, sources, targets and weights.
graph: (String) GEXF (XML) representation of the graph.
gexfclass object (list). Contains the following:
The GEXF project website: http://gexf.net
## Not run: # demo(gexf) # Example of gexf command using fictional data. # demo(gexfattributes) # Working with attributes. # demo(gexfbasic) # Basic net. # demo(gexfdynamic) # Dynamic net. # demo(edge.list) # Working with edges lists. # demo(gexffull) # All the package. # demo(gexftwitter) # Example with real data of chilean twitter accounts. # demo(gexfdynamicandatt) # Dynamic net with static attributes. # demo(gexfbuildfromscratch) # Example building a net from scratch. # ## End(Not run)