View source: R/acdc_analyse_record.R
acdc_animate_record | R Documentation |
This function is a simple wrapper for acdc_plot_record
and saveHTML
which creates an animation of the AC* algorithm(s) over time. To implement this function, a named list of arguments for acdc_plot_record
, which creates the plots, must be supplied. This is embedded within saveHTML
, which creates a folder in the specified directory named ‘images’ that contains a .png file for each time step and an animation as a .html file.
acdc_animate_record(
expr_param,
dir = NULL,
html_name = "ACDC_algorithm_demo.html",
image_name = "ACDC",
html_title = "Demonstration of the ACDC Algorithm",
html_description = "",
navigator = FALSE,
ani_height = 1000,
ani_width = 1000,
ani_res = 150,
interval = 0.1,
verbose = FALSE,
...
)
expr_param |
A named list of arguments, passed to |
dir |
(optional) A string that defines the directory in which to save files. If unsupplied, if available, |
html_name |
A string that defines the name of the html file (see ‘htmlfile’ argument in |
image_name |
A string that defines the names of the individual .png files creates (see ‘img.name’ argument in |
html_title , html_description |
Character strings that provide a title and a description that are displayed within the html animation (see ‘title’ and ‘description’ arguments in |
navigator |
A logical variable that defines whether or not to add a navigator panel to the animation (see ‘navigator’ argument in |
ani_height , ani_width , ani_res |
Numbers that define the size and the resolution of the animation (see ‘ani.height’ ‘ani.width’ and ‘ani.res’ arguments in |
interval |
A number that defines the time interval between sequential frames (see ‘interval’ argument in |
verbose |
A logical or character variable that defines whether or not, or what, to write as a footer to the html animation (see ‘verbose’ argument in |
... |
Additional arguments passed to |
This function requires the animation
package.
The function produces an animation in .html format in the specified directory. A folder named ‘images’ is also produced which contains the images for each time step. The ‘css’ and ‘js’ folders are also produced by saveHTML
which creates the animation.
Edward Lavender
dir_current <- getwd()
setwd(tempdir())
acdc_record <- acdc_simplify(dat_acdc)
acdc_animate_record(
expr_param =
list(
record = acdc_record,
add_coastline = list(x = dat_coast, col = "darkgreen"),
plot = 1:5,
fix_zlim = FALSE
)
)
setwd(dir_current)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.