Parcourir la source

Use anim_opts = anim_options() instead of NULL

Leads to better documentation where it is easier to understand how to use the anim_opts parameter
pkg-add-anim-opts-fixed
Garrick Aden-Buie il y a 7 ans
Parent
révision
e689eefdad
3 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. +2
    -2
      R/animate_tidyr.R
  2. +1
    -1
      man/animate_gather.Rd
  3. +1
    -1
      man/animate_spread.Rd

+ 2
- 2
R/animate_tidyr.R Voir le fichier

@@ -28,7 +28,7 @@
#' # if you want to have a less detailed animation, you can also use
#' animate_gather(wide, "person", "sales", -year, export = "gif", detailed = FALSE)
#' }
animate_gather <- function(w, key, value, ..., export = "gif", detailed = TRUE, anim_opts = NULL) {
animate_gather <- function(w, key, value, ..., export = "gif", detailed = TRUE, anim_opts = anim_options()) {
anim_opts <- default_anim_opts("gather", anim_opts)
lhs <- w
rhs <- tidyr::gather(w, !!key, !!value, ...)
@@ -88,7 +88,7 @@ animate_gather <- function(w, key, value, ..., export = "gif", detailed = TRUE,
#' # if you want to have a less detailed animation, you can also use
#' animate_spread(long, key = "person", value = "sales", export = "gif", detailed = FALSE)
#' }
animate_spread <- function(l, key, value, export = "gif", detailed = TRUE, ..., anim_opts = NULL) {
animate_spread <- function(l, key, value, export = "gif", detailed = TRUE, ..., anim_opts = anim_options()) {
anim_opts <- default_anim_opts("spread", anim_opts)

lhs <- l

+ 1
- 1
man/animate_gather.Rd Voir le fichier

@@ -5,7 +5,7 @@
\title{Animates the gather function}
\usage{
animate_gather(w, key, value, ..., export = "gif", detailed = TRUE,
anim_opts = NULL)
anim_opts = anim_options())
}
\arguments{
\item{w}{a data_frame in the wide format}

+ 1
- 1
man/animate_spread.Rd Voir le fichier

@@ -5,7 +5,7 @@
\title{Animates the spread function}
\usage{
animate_spread(l, key, value, export = "gif", detailed = TRUE, ...,
anim_opts = NULL)
anim_opts = anim_options())
}
\arguments{
\item{l}{a data_frame in the long/tidy format}

Chargement…
Annuler
Enregistrer