Learn R Programming

FloodMapper (version 1.0)

FM.animate: Create An Animation for An Existing Model Run

Description

Once a model run is completed successfully, users can use this function to create an animation into a *.gif file.

Usage

FM.animate(runname = "", workdir = "")

Arguments

runname

(OPTIONAL) the name of an existing model run. If it is empty, the current model run will be selected.

workdir

(OPTIONAL) full path to user's work directory. If it is empty, the work directory of current model run will be selected.

Examples

Run this code
# NOT RUN {
## Load FloodMapper package
library(FloodMapper)

s_return <- NA

## Assume that the current model run with a name of "Lafayette_1km" 
## has been completed successfully, you can run the following
## command to create an animation in *.gif format.
# }
# NOT RUN {
    s_return <- FM.animate("Lafayette_1km", workdir = tempdir())
# }
# NOT RUN {
## Check if there are any errors
if (!is.na(s_return)) {
    if (s_return != "") {
        cat("Creating animation is failed because of the following error:\n")
        cat(s_return)
    } else {
        cat("Creating animation is successful!\n")
    }
}
# }

Run the code above in your browser using DataLab