Sfoglia il codice sorgente

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 7 anni fa
parent
commit
e689eefdad
3 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  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 Vedi File

#' # if you want to have a less detailed animation, you can also use #' # 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(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) anim_opts <- default_anim_opts("gather", anim_opts)
lhs <- w lhs <- w
rhs <- tidyr::gather(w, !!key, !!value, ...) rhs <- tidyr::gather(w, !!key, !!value, ...)
#' # if you want to have a less detailed animation, you can also use #' # 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(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) anim_opts <- default_anim_opts("spread", anim_opts)


lhs <- l lhs <- l

+ 1
- 1
man/animate_gather.Rd Vedi File

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

+ 1
- 1
man/animate_spread.Rd Vedi File

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

Loading…
Annulla
Salva