In package HiveR, hive plot data sets are stored as an S3 class called HivePlotData, detailed below.
Structure
The structure of a HivePlotData object is a list of 6 elements, some of which are data frames, and an attribute, as follows:
element
(element)
type
description
$nodes
data frame
Data frame of node properties
$id
int
Node identifier
$lab
chr
Node label
$axis
int
Axis to which node is assigned
$radius
num
Radius (position) of node along the axis
$size
num
Node size in pixels
$color
chr
Node color
$edges
data frame
Data frame of edge properties
$id1
int
Starting node id
$id2
int
Ending node id
$weight
num
Width of edge in pixels
$color
chr
Edge color
$type
chr
Type of hive. See Note.
$desc
chr
Description of data
$axis.cols
chr
Colors for axes
- attr
chr "HivePlotData"
The S3 class designation.
Note
While $edges$id1 and $edges$id2 are defined as the starting and ending nodes of a particular edge, hive plots as currently implemented are not directed graphs (agnostic might be a better word).
HPD$type indicates the type of hive data: If 2D, then the data is intended to be plotted with hivePlot which is a 2D plot with axes radially oriented, and (hopefully) no edges that cross axes. If 3D, then the data is intended to be plotted with plot3dHive which gives an interactive 3D plot, with axes oriented in 3D.
sumHPD to summarize a HivePlotData object. chkHPD to verify the integrity of a HivePlotData object. ranHiveData to generate random HivePlotData objects for testing and demonstration.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(HiveR)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HiveR/HivePlotData.Rd_%03d_medium.png", width=480, height=480)
> ### Name: HivePlotData
> ### Title: Hive Plot Data Objects
> ### Aliases: HPD ' HivePlotData '
> ### Keywords: classes
>
> ### ** Examples
>
> test4 <- ranHiveData(nx = 4)
> str(test4)
List of 5
$ nodes :'data.frame': 52 obs. of 6 variables:
..$ id : int [1:52] 2 3 4 5 7 8 9 10 11 12 ...
..$ lab : chr [1:52] "mcyhb" "ryiux" "kxwex" "qlghc" ...
..$ axis : int [1:52] 1 1 4 1 3 3 2 1 1 2 ...
..$ radius: num [1:52] 54 75 42 28 41 58 74 40 4 55 ...
..$ size : num [1:52] 1 1.5 1 1 1 1.5 0.5 1 0.5 1 ...
..$ color : chr [1:52] "#E41A1C" "#FF7F00" "#984EA3" "#FF7F00" ...
$ edges :'data.frame': 60 obs. of 4 variables:
..$ id1 : int [1:60] 27 5 15 5 3 34 10 11 34 37 ...
..$ id2 : int [1:60] 57 28 58 12 28 60 51 57 39 9 ...
..$ weight: num [1:60] 2 2 3 1 3 3 2 1 3 3 ...
..$ color : chr [1:60] "#984EA3" "#FF7F00" "#377EB8" "#984EA3" ...
$ type : chr "2D"
$ desc : chr "4 axes -- 52 nodes -- 60 edges"
$ axis.cols: chr [1:4] "#E41A1C" "#377EB8" "#4DAF4A" "#984EA3"
- attr(*, "class")= chr "HivePlotData"
> sumHPD(test4)
4 axes -- 52 nodes -- 60 edges
This hive plot data set contains 52 nodes on 4 axes and 60 edges.
It is a 2D data set.
Axis 1 has 14 nodes spanning radii from 3 to 99
Axis 2 has 14 nodes spanning radii from 3 to 98
Axis 3 has 12 nodes spanning radii from 6 to 93
Axis 4 has 12 nodes spanning radii from 2 to 99
Axes 1 and 2 share 15 edges
Axes 2 and 3 share 15 edges
Axes 3 and 4 share 15 edges
Axes 4 and 1 share 15 edges
> plotHive(test4)
>
>
>
>
>
> dev.off()
null device
1
>