animateHive: Animate One or More 3D Hive Plots with a Handy Controller

Description Usage Arguments Value Warning Author(s) Examples

View source: R/animateHive.R

Description

This function takes a list of HivePlotData objects of type = "3D" and plots each in its own rgl window using its own arguments, then adds a controller which handles rotation and scaling.

Usage

1
animateHive(hives = list(), cmds = list(), xy = 400, ...)

Arguments

hives

A list of HivePlotData objects.

cmds

A list of arguments corresponding to how you want each hive plotted.

xy

An integer giving the size of the rgl window in pixels.

...

Other parameters to be passed downstream to rgl.

Value

None. Side effect is one or more plots.

Warning

If you click the 'continue rotating' box on the controller window, be sure to unclick it and wait for the system to halt before closing any of the windows. If you close the controller w/o doing this, the remaining open windows with the hive plots will continue rotating endlessly and it seems you can't get their attention to close the windows.

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
require("rgl")
# Sillyness: let's draw different hives with different settings
# List of hives
t4 <- ranHiveData(type = "3D", nx = 4)
t5 <- ranHiveData(type = "3D", nx = 5)
t6 <- ranHiveData(type = "3D", nx = 6)
myhives <- list(t4, t5, t6)
# List of arguments to plot in different coordinate systems
cmd1 <- list(method = "abs", LA = TRUE, dr.nodes = FALSE, ch = 10)
cmd2 <- list(method = "rank", LA = TRUE, dr.nodes = FALSE, ch = 2)
cmd3 <- list(method = "norm", LA = TRUE, dr.nodes = FALSE, ch = 0.1)
mycmds <- list(cmd1, cmd2, cmd3)
#
animateHive(hives = myhives, cmds = mycmds)

## End(Not run)

bryanhanson/HiveR documentation built on June 12, 2020, 2:08 a.m.