View source: R/hypervolume_save_animated_gif.R
hypervolume_save_animated_gif | R Documentation |
Rotates the plot around an axis at a given speed and saves results as a series of GIFs. Requires that the rgl
library is installed. Assumes there is an open RGL plot (e.g. from calling plot(hv, show.3d=TRUE)
). If the magick
package is available, combines these GIFs into a single animation.
hypervolume_save_animated_gif(image.size = 400,
axis = c(0, 0, 1), rpm = 4, duration = 15, fps = 10,
file.name = "movie", directory.output = ".", ...)
image.size |
Number of pixels on each side of the animated image. |
axis |
A three-element vector describing the rotation axis. |
rpm |
Animation speed in rotations per minute. |
duration |
Animation duration in seconds. |
fps |
Animation speed in frames per second. |
file.name |
A base name (no extension) for the GIFs. |
directory.output |
The folder in which output should be located. |
... |
Other arguments to be passed to |
None; used for the side-effect of producing files.
## Not run:
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
hv = hypervolume_gaussian(penguins_adelie,name='Adelie')
if(interactive())
{
plot(hv, show.3d=TRUE)
hypervolume_save_animated_gif()
rgl.close()
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.