edge2HPD: Process an Edge List into a Hive Plot Data Object

View source: R/edge2HPD.R

edge2HPDR 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 c("2D", "3D"). If 2D, a HivePlotData object suitable for use with plotHive will be created and the eventual hive plot will be static and 2D. If 3D, the HivePlotData object will be suitable for a 3D interactive plot using plot3dHive.

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

dot2HPD and adj2HPD

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

HiveR documentation built on Sept. 12, 2024, 7:25 a.m.