edge2HPD {HiveR} | R Documentation |
Process an Edge List into a Hive Plot Data Object
Description
This function will take an edge list and convert it into a basic
HivePlotData
object. Further manipulation by
mineHPD
will almost certainly be required before the data can
be plotted.
Usage
edge2HPD(edge_df = NULL, axis.cols = NULL, type = "2D", desc = NULL, ...)
Arguments
edge_df |
A data frame containing edge list information. Columns should be node1, node2, edge weight (column names are arbitrary). Edge weight information is optional. If missing, edge weights will be set to 1. |
axis.cols |
A character vector giving the colors desired for the axes. |
type |
One of |
desc |
Character. A description of the data set. |
... |
Other parameters to be passed downstream. |
Details
This function produces a "bare bones" HivePlotData
object. The user
will likely have to make some changes manually to the resulting
HivePlotData
object before plotting. Alternatively,
mineHPD
may be able to extract some information buried in the
data, but even then, the user might need to make some adjustments. See the
examples.
Value
A HivePlotData
object.
Author(s)
Jonathan H. Chung, with minor changes for consistency by Bryan A. Hanson.
See Also
Examples
# Create a simple edge list & process it
edges <- data.frame(
lab1 = LETTERS[c(1:8, 7)],
lab2 = LETTERS[c(2:4, 1:3, 4, 2, 2)],
weight = c(1, 1, 2, 2, 3, 1, 2, 3, 1)
)
td <- edge2HPD(edge_df = edges, desc = "Test of edge2HPD")
td.out <- sumHPD(td, plot.list = TRUE)
# compare:
edges
td.out[, c(3, 7, 8)]