Last data update: 2014.03.03

R: Modify the display of axes and nodes in a hive plot
manipAxisR Documentation

Modify the display of axes and nodes in a hive plot

Description

This function modifies various aspects of a HivePlotData object. A typical use is to convert the radii from the native/absolute values in the original object to either a normalized value (0...1) or to a ranked value. The order of nodes on an axis can also be inverted, and an axis can be pruned (removed) from the HivePlotData object.

Usage

manipAxis(HPD, method, action = NULL, ...)

Arguments

HPD

An object of S3 class HivePlotData.

method

One of c("rank", "norm", "scale", "invert", "ranknorm", "prune", "offset", "stretch") giving the type of modification to be made.

action

For method = c("scale", "invert", "offset", "stretch"), a numeric vector of the same length as the number of axes.

...

Arguments to be passed downstream. Needed in this case for when plotHive has arguments for grid that get laundered through manipAxis

Details

The rank method uses ties.method = "first" so that each node gets a unique radius. For pruning, the nodes and edges are removed and then the remaining axes are renumbered to start from one. Exercise caution!

For "scale" node radii will be multiplied by the corresponding value in this argument. For "invert" a value of -1 will cause the corresponding axis to be inverted. For "prune", a single value specifying the axis to be pruned should be given. For "offset" the values in "action" will be subtracted from the node radii. For "stretch", node radii will first be offset so that the minimum value is zero, then multiplied by the values in "action" to stretch the axis. Depending upon the desired effect, one might use "stretch" followed by "offset" or perhaps other combinations.

Value

A modified HivePlotData object.

Author(s)

Bryan A. Hanson, DePauw University. hanson@depauw.edu

References

http://academic.depauw.edu/~hanson/HiveR/HiveR.html

Examples

data(HEC)
# The first 3 examples take advantage of the argument '...'
# in plotHive, which passes action through to manipAxis on the fly.
# For this particular data, norm and absolute scaling appear the same.

plotHive(HEC, bkgnd = "white") # default is absolute positioning of nodes
plotHive(HEC, method = "rank", bkgnd = "white")
plotHive(HEC, method = "norm", bkgnd = "white")

# In these examples, we'll explicitly use manipAxis and then plot
# in a separate step.  This is because trying to plot on the fly in
# these cases will result in absolute scaling (which we do use here,
# but one might not want to be forced to do so).

HEC2 <- manipAxis(HEC, method = "invert", action = c(-1, 1))
plotHive(HEC2, bkgnd = "white")
HEC3 <- manipAxis(HEC, method = "stretch", action = c(2,3))
plotHive(HEC3, bkgnd = "white")
HEC4 <- manipAxis(HEC, method = "offset", action = c(0, 1.5))
plotHive(HEC4, bkgnd = "white")

Results


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/manipAxis.Rd_%03d_medium.png", width=480, height=480)
> ### Name: manipAxis
> ### Title: Modify the display of axes and nodes in a hive plot
> ### Aliases: manipAxis
> ### Keywords: utilities
> 
> ### ** Examples
> 
> data(HEC)
> # The first 3 examples take advantage of the argument '...'
> # in plotHive, which passes action through to manipAxis on the fly.
> # For this particular data, norm and absolute scaling appear the same.
> 
> plotHive(HEC, bkgnd = "white") # default is absolute positioning of nodes
> plotHive(HEC, method = "rank", bkgnd = "white")
> plotHive(HEC, method = "norm", bkgnd = "white")
> 
> # In these examples, we'll explicitly use manipAxis and then plot
> # in a separate step.  This is because trying to plot on the fly in
> # these cases will result in absolute scaling (which we do use here,
> # but one might not want to be forced to do so).
> 
> HEC2 <- manipAxis(HEC, method = "invert", action = c(-1, 1))
> plotHive(HEC2, bkgnd = "white")
> HEC3 <- manipAxis(HEC, method = "stretch", action = c(2,3))
> plotHive(HEC3, bkgnd = "white")
> HEC4 <- manipAxis(HEC, method = "offset", action = c(0, 1.5))
> plotHive(HEC4, bkgnd = "white")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>