This function adds or subtracts one from the counter depending on the tally counter type used, defined within the tally_counter function. It returns the number padded to a minimum of four characters. Once counter has finished the environment and counter object are removed.

click()

Value

The count number padded to a minimum of four characters.

See also

Other tally counter methods: tally_counter()

Examples

suppressPackageStartupMessages({ library(store) suppressWarnings({ library(palmerpenguins) library(dplyr) library(stringr) library(purrr) }) }) penguin_stats <- function(...) { # get row data <- list(...) # get penguins stats species <- purrr::pluck(data, "species") island <- purrr::pluck(data, "island") body_mass_g <- purrr::pluck(data, "body_mass_g") sex <- purrr::pluck(data, "sex") year <- purrr::pluck(data, "year") # print penguin stats message(stringr::str_glue("{click()} : The body mass for the {sex} {species} penguin recorded in {year} on {island} island is {body_mass_g} grams")) } penguin_stats_slow <- slowly(penguin_stats, rate_delay(0.1)) penguins %>% slice_sample(n = 10) %>% arrange(desc(body_mass_g)) %>% tally_counter(type = "add") %>% pwalk(penguin_stats_slow)
#> 0000 tally counter
#> 0001 : The body mass for the male Gentoo penguin recorded in 2008 on Biscoe island is 5550 grams
#> 0002 : The body mass for the female Gentoo penguin recorded in 2008 on Biscoe island is 5100 grams
#> 0003 : The body mass for the female Gentoo penguin recorded in 2009 on Biscoe island is 4975 grams
#> 0004 : The body mass for the male Adelie penguin recorded in 2008 on Biscoe island is 4400 grams
#> 0005 : The body mass for the male Adelie penguin recorded in 2007 on Biscoe island is 3950 grams
#> 0006 : The body mass for the male Chinstrap penguin recorded in 2009 on Dream island is 3800 grams
#> 0007 : The body mass for the female Adelie penguin recorded in 2008 on Torgersen island is 3700 grams
#> 0008 : The body mass for the female Adelie penguin recorded in 2007 on Torgersen island is 3450 grams
#> 0009 : The body mass for the male Adelie penguin recorded in 2007 on Dream island is 3425 grams
#> 0010 : The body mass for the female Adelie penguin recorded in 2008 on Biscoe island is 2900 grams