Before introducing animations with "ggplot2", "gganimate", ... into my R package document, devtools::check() returned no errors, warnings or notes. Now, I am receiving the following message:
### ** Examples
>
> cfanim(60, 3, 30, 0.25)
Error in theme_set(theme_bw()) : could not find function "theme_set"
Calls: cfanim
Execution halted.
My function "cfamin" generates an animation. The reasons given in the log are:
no visible global function definition for ‘gganimate’
Undefined global functions or variables:
aes geom_line geom_point gganimate ggplot theme_bw theme_set x.
I suspect the problem occurs because "roxygen2" is unable to (1) add it or (2) suggest that these them to be added to the DESCRIPTION file. This is what I expect to see:
importFrom("stats", "rnorm")
importFrom("stats", "sd")
importFrom("graphics", "text")
importFrom("stats", "rlnorm")
importFrom("grDevices", "dev.hold")
importFrom("utils", "install.packages")
I have used devtools::use_package("XXX")
to install them and have the Oxygen options checked to generate Rd, collate field, NAMESPACE and vignettes automatically when running, R CMD check, source and binary builds and build and reload. Furthermore, according to Wickham Hadley's book, these packages should be listed in the DESCRIPTION file. They are:
Imports:
sde,
gganimate,
ggplot2,
plyr
I am stumped. Any help would be greatly appreciated.
Thanks,
Paul