Can be used in dplyr-syntax to remember values and objects for later use. Objects are (temporarily) stored in the certetoolbox package environment.

remember(.data, ...)

recall(x = NULL, delete = TRUE)

Arguments

.data

data.frame

...

value(s) to be remembered

x

value to be recalled

delete

a logical to indicate whether the delete value after recalling

Details

values can be saved with remember() and recalled (and deleted) with recall().

Examples

library(dplyr, warn.conflicts = FALSE)

x <- mtcars %>% remember(nrow(.)) 
recall()
#> [1] 32
recall() # value removed
#> NULL
x <- mtcars %>% remember(n = nrow(.)) 
recall(n)
#> [1] 32
recall(n) # value removed
#> NULL

if (FALSE) { # \dontrun{
 tbl %>%
   filter(...) %>%
   remember(rows = nrow(.)) %>%
   group_by(...) %>%
   summarise(...) %>%
   plot2(title = "Test",
         subtitle = paste("n =", recall(rows)))
} # }