render_plotly: Animation the frames as a HTML widget.

Description Usage Arguments See Also Examples

View source: R/2_render.r

Description

[Superseded], see ggtour. Takes the result of array2df() and animations them via {plotly} into a self-contained HTML widget.

Usage

1
render_plotly(fps = 8L, html_filename = NULL, save_widget_args = list(), ...)

Arguments

fps

Frames animated per second. Defaults to 8.

html_filename

Optional, saves the plotly object as an HTML widget to this string (without the directory path). Defaults to NULL (not saved). For more output control use save_widget_args or call htmlwidgets::saveWidget() on a return object of render_plotly().

save_widget_args

A list of arguments to be called in htmlwidgets::saveWidget() when used with a html_filename.

...

Passes arguments to render_(...).

See Also

render_ for ... arguments.

ggplotly for source documentation of tooltip.

saveWidget for more control of .html output.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
dat_std <- scale_sd(wine[, 2:6])
clas <- wine$Type
bas <- basis_pca(dat_std)
mv <- manip_var_of(bas)
mt_array <- manual_tour(basis = bas, manip_var = mv)
mt_df_ls <- array2df(basis_array = mt_array, data = dat_std)

## Not run: 
render_plotly(frames = mt_df_ls)

require("ggplot2")
render_plotly(
  frames = mt_df_ls, axes = "bottomleft", fps = 10,
  aes_args = list(color = clas, shape = clas),
  identity_args = list(size = 1.5, alpha = .7),
  ggproto = list(theme_bw(), scale_color_brewer(palette = "Set2")))

## Saving a .gif, may require additional setup
if(F) ## Don't run by mistake
  render_plotly(frames = mt_df_ls, axes = "bottomleft", fps = 10,
                html_filename = "myRadialTour.html")
## End(Not run)

spinifex documentation built on Sept. 28, 2021, 5:09 p.m.