conditionz/0000755000176200001440000000000013460052167012436 5ustar liggesusersconditionz/tests/0000755000176200001440000000000012620714764013605 5ustar liggesusersconditionz/tests/testthat/0000755000176200001440000000000013415140410015425 5ustar liggesusersconditionz/tests/testthat/test-handle_conditions.R0000644000176200001440000000204013415166003022213 0ustar liggesuserscontext("handle_conditions") foom <- function(x) { message("you gave: ", x) return(x) } foow <- function(x) { warning("you gave: ", x) return(x) } test_that("handle_conditions", { expect_message(foom('a'), "you gave:") expect_message(handle_conditions(foom('a')), "you gave:") expect_message(handle_conditions(foom('a'), "message"), "you gave:") # returns whatever is passed to it x <- handle_conditions(5) expect_equal(x, 5) }) test_that("handle_messages", { expect_identical( suppressMessages(handle_conditions(foom('a'))), suppressMessages(handle_messages(foom('a'))) ) }) test_that("handle_warnings", { expect_identical( suppressWarnings(handle_conditions(foow('a'), "warning")), suppressWarnings(handle_warnings(foow('a'))) ) }) test_that("handle_conditions fails well", { expect_error(handle_conditions(), "\"expr\" is missing") expect_error(handle_conditions(5, "foobar"), "'condition' must be one of") expect_error(handle_conditions(5, times = "foo"), "times must be of class") }) conditionz/tests/testthat/test-ConditionKeeper.R0000644000176200001440000000436513453477771021650 0ustar liggesuserscontext("ConditionKeeper: general") test_that("ConditionKeeper works", { x <- ConditionKeeper$new(times = 4) expect_is(x, "ConditionKeeper") expect_is(x, "R6") expect_equal(x$condition, "message") expect_equal(x$times, 4) expect_null(x$bucket) expect_is(x$get_id, "function") expect_is(x$handle_conditions, "function") expect_is(x$thrown_enough, "function") expect_is(x$thrown_times, "function") expect_is(x$not_thrown_yet, "function") expect_is(x$thrown_already, "function") expect_is(x$purge, "function") expect_is(x$remove, "function") expect_is(x$add, "function") expect_is(x$get_id(), "character") expect_is(x$add("one"), "ConditionKeeper") expect_is(x$add("two"), "ConditionKeeper") expect_equal(length(x$bucket), 2) }) context("ConditionKeeper: print") test_that("ConditionKeeper: print", { x <- ConditionKeeper$new(times = 8) expect_output(x$print(), "ConditionKeeper") expect_output(x$print(), "id:") expect_output(x$print(), "times:") expect_output(x$print(), "messages:") }) context("ConditionKeeper: remove") test_that("ConditionKeeper: remove", { x <- ConditionKeeper$new(times = 4) # nothing to remove expect_null(x$remove()) # add something to remove mssg <- "brown cow" x$add(mssg) # remove it z <- x$remove() expect_equal(z, mssg) ## and now x is empty expect_equal(length(x$bucket), 0) }) context("ConditionKeeper: handle_conditions") test_that("ConditionKeeper: handle_conditions", { x <- ConditionKeeper$new(times = 4) foo <- function(x) { message("you gave: ", x) return(x) } expect_message(x$handle_conditions(foo('a')), "you gave: a") expect_message(x$handle_conditions(foo('a')), "you gave: a") expect_message(x$handle_conditions(foo('a')), "you gave: a") expect_message(x$handle_conditions(foo('a')), "you gave: a") expect_message(x$handle_conditions(foo('a')), NA) }) context("ConditionKeeper: fails well") test_that("ConditionKeeper fails well", { expect_error(ConditionKeeper$new(times = "a"), "times must be of class numeric, integer") expect_error(ConditionKeeper$new(condition = 5), "condition must be of class character") expect_error(ConditionKeeper$new(condition = "elephant"), "'condition' must be one of 'message' or 'warning'") }) conditionz/tests/testthat/test-capture_warning.R0000644000176200001440000000121113415050165021717 0ustar liggesuserscontext("capture_warning") test_that("capture_warning", { foom <- function(x) { warning("its too bad") return(x) } z <- capture_warning(foom(4)) expect_is(z, "list") expect_equal(z$value, 4) expect_is(z$text, "list") expect_named(z$text, NULL) expect_is(z$text[[1]], 'warning') expect_named(z$text[[1]], c('message', 'call')) expect_equal(z$type, "warning") }) test_that("capture_warning: no warning included", { x <- capture_warning(5) expect_is(x, "list") expect_null(x$text) expect_equal(x$value, 5) }) test_that("capture_warning fails well", { expect_error(capture_warning(), "\"expr\" is missing") }) conditionz/tests/testthat/test-capture_message.R0000644000176200001440000000121113415050060021670 0ustar liggesuserscontext("capture_message") test_that("capture_message", { foom <- function(x) { message("its too bad") return(x) } z <- capture_message(foom(4)) expect_is(z, "list") expect_equal(z$value, 4) expect_is(z$text, "list") expect_named(z$text, NULL) expect_is(z$text[[1]], 'message') expect_named(z$text[[1]], c('message', 'call')) expect_equal(z$type, "message") }) test_that("capture_message: no message included", { x <- capture_message(5) expect_is(x, "list") expect_null(x$text) expect_equal(x$value, 5) }) test_that("capture_message fails well", { expect_error(capture_message(), "\"expr\" is missing") }) conditionz/tests/test-all.R0000644000176200001440000000010113402570006015431 0ustar liggesuserslibrary(testthat) library("conditionz") test_check("conditionz") conditionz/NAMESPACE0000644000176200001440000000036513453665142013666 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(ConditionKeeper) export(capture_message) export(capture_warning) export(handle_conditions) export(handle_messages) export(handle_warnings) importFrom(R6,R6Class) importFrom(uuid,UUIDgenerate) conditionz/NEWS.md0000644000176200001440000000011013453500271013520 0ustar liggesusersconditionz 0.1.0 ================ ### NEW FEATURES * Released to CRAN conditionz/R/0000755000176200001440000000000013453665747012657 5ustar liggesusersconditionz/R/ConditionKeeper.R0000644000176200001440000000740313453500375016051 0ustar liggesusers#' ConditionKeeper #' #' @export #' @param times (integer) number of times to throw condition. required. #' default: 1 #' @param condition (character) which condition, one of "message" (default) or #' "warning" #' @format NULL #' @usage NULL #' @details #' **Methods** #' #' - `add(x)` - add a condition to internal storage #' - `remove()` - remove the first condition from internal storage; returns that #' condition so you know what you removed #' - `purge()` - removes all conditions #' - `thrown_already(x)` - (return: logical) has the condition been thrown #' already? #' - `not_thrown_yet(x)` - (return: logical) has the condition NOT been thrown #' yet? #' - `thrown_times(x)` - (return: numeric) number of times the condition #' has been thrown #' - `thrown_enough(x)` - (return: logical) has the condition been thrown #' enough? "enough" being: thrown number of times equal to what you #' specified in the `times` parameter #' - `get_id()` - get the internal ID for the ConditionKeeper object #' - `handle_conditions(expr)` - pass a code block or function and handle #' conditions within it #' #' @seealso [handle_conditions()] #' #' @examples #' x <- ConditionKeeper$new(times = 4) #' x #' x$get_id() #' x$add("one") #' x$add("two") #' x #' x$thrown_already("one") #' x$thrown_already("bears") #' x$not_thrown_yet("bears") #' #' x$add("two") #' x$add("two") #' x$add("two") #' x$thrown_times("two") #' x$thrown_enough("two") #' x$thrown_enough("one") #' #' foo <- function(x) { #' message("you gave: ", x) #' return(x) #' } #' foo('a') #' x$handle_conditions(foo('a')) #' #' x <- ConditionKeeper$new(times = 4, condition = "warning") #' x #' x$add("one") #' x$add("two") #' x ConditionKeeper <- R6::R6Class("ConditionKeeper", public = list( bucket = NULL, times = 1, condition = "message", initialize = function(times = 1, condition = "message") { assert(times, c('numeric', 'integer')) self$times <- times assert(condition, "character") if (!condition %in% c("message", "warning")) { stop("'condition' must be one of 'message' or 'warning'", call. = FALSE) } self$condition <- condition # assign unique id to the class object private$id <- uuid::UUIDgenerate() }, print = function(x, ...) { cat('ConditionKeeper', sep = "\n") cat(paste0(' id: ', private$id), sep = "\n") cat(paste0(' times: ', self$times), sep = "\n") cat(paste0(' messages: ', length(self$bucket))) if (length(self$bucket) > 0) { cat("\n") for (i in self$bucket) { cat(paste0(" ", substring(i, 1, 50))) } } }, add = function(x) { self$bucket <- c(self$bucket, x) invisible(self) }, remove = function() { if (length(self$bucket) == 0) return(NULL) head <- self$bucket[[1]] self$bucket <- self$bucket[-1] head }, purge = function() { self$bucket <- NULL }, thrown_already = function(x) { x %in% self$bucket }, not_thrown_yet = function(x) { !self$thrown_already(x) }, thrown_times = function(x) { length(self$bucket[self$bucket %in% x]) }, thrown_enough = function(x) { self$thrown_times(x) >= self$times }, get_id = function() private$id, handle_conditions = function(expr) { res <- capture_x(self$condition)(expr) if (!is.null(res$text)) { txt <- res$text[[1]][['message']] if (!self$thrown_enough(txt)) { self$add(txt) switch( self$condition, message = eval(parse(text=self$condition))(txt), warning = eval(parse(text=self$condition))(txt, call. = FALSE) ) } } return(res$value) } ), private = list( id = NULL ) ) conditionz/R/conditionz-package.R0000644000176200001440000000035413402564273016537 0ustar liggesusers#' condition control #' #' @importFrom R6 R6Class #' @importFrom uuid UUIDgenerate #' @name conditionz-package #' @aliases conditionz #' @docType package #' @author Scott Chamberlain #' @keywords package NULL conditionz/R/handle_conditions.R0000644000176200001440000000406313453500445016450 0ustar liggesusersconditonz_env <- new.env() #' Handle conditions #' #' @export #' @param expr an expression #' @param condition (character) one of "message" or "warning" #' @param times (integer) max. times a condition should be thrown. #' default: 1 #' @return whatever the `expr` returns #' @details Uses [ConditionKeeper] internally #' @examples #' foo <- function(x) { #' message("you gave: ", x) #' return(x) #' } #' #' foo('a') #' capture_message(foo('a')) #' handle_conditions(foo('a')) #' suppressMessages(handle_conditions(foo('a'))) #' handle_conditions(foo('a'), "message") #' #' bar <- function(x) { #' for (i in x) message("you gave: ", i) #' return(x) #' } #' bar(1:5) #' handle_conditions(bar(1:5)) #' #' handle_messages(foo('a')) #' #' hello <- function(x) { #' warning("you gave: ", x) #' return(x) #' } #' handle_warnings(hello('a')) #' #' # code block #' handle_warnings({ #' as.numeric(letters[1:3]) #' as.numeric(letters[4:6]) #' as.numeric(letters[7:9]) #' }) handle_conditions <- function(expr, condition = "message", times = 1) { if (!condition %in% c("message", "warning")) { stop("'condition' must be one of 'message' or 'warning'", call. = FALSE) } cond_keep <- ConditionKeeper$new(times = times, condition = condition) assign(cond_keep$get_id(), cond_keep, envir = conditonz_env) on.exit(cond_keep$purge()) res <- capture_x(condition)(expr) if (!is.null(res$text)) { txt <- res$text[[1]][['message']] if (!cond_keep$thrown_enough(txt)) { cond_keep$add(txt) switch( condition, message = eval(parse(text=condition))(txt), warning = eval(parse(text=condition))(txt, call. = FALSE) ) } } return(res$value) } #' @export #' @rdname handle_conditions handle_messages <- function(expr, times = 1) { handle_conditions(expr, "message", times = times) } #' @export #' @rdname handle_conditions handle_warnings <- function(expr, times = 1) { handle_conditions(expr, "warning", times = times) } # helpers ------ capture_x <- function(x) { eval(parse(text = paste0("capture_", x))) } conditionz/R/capture_condition.R0000644000176200001440000000207513402564646016505 0ustar liggesuserscc_generator <- function(condition = "message") { function(expr) { x <- NULL handler <- function(w) { x <<- c(x, list(w)) switch( condition, message = invokeRestart("muffleMessage"), warning = invokeRestart("muffleWarning") ) } val <- switch( condition, message = withCallingHandlers(expr, message = handler), warning = withCallingHandlers(expr, warning = handler) ) switch( condition, message = list(value = val, text = x, type = "message"), warning = list(value = val, text = x, type = "warning") ) } } #' @export #' @rdname capture_condition capture_message <- cc_generator("message") #' @export #' @rdname capture_condition capture_warning <- cc_generator("warning") #' capture condition #' #' @name capture_condition #' @keywords internal #' @examples #' foom <- function(x) { #' message("its too bad") #' return(x) #' } #' capture_message(foom(4)) #' #' foow <- function(x) { #' warning("its too bad") #' return(x) #' } #' capture_warning(foow(4)) NULL conditionz/R/zzz.R0000644000176200001440000000036613402410161013610 0ustar liggesuserscpt <- function(l) Filter(Negate(is.null), l) assert <- function(x, y) { if (!is.null(x)) { if (!inherits(x, y)) { stop(deparse(substitute(x)), " must be of class ", paste0(y, collapse = ", "), call. = FALSE) } } } conditionz/README.md0000644000176200001440000001062713453500773013726 0ustar liggesusersconditionz ========== [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) [![Build Status](https://travis-ci.com/ropenscilabs/conditionz.svg?branch=master)](https://travis-ci.com/ropenscilabs/conditionz) [![codecov.io](https://codecov.io/github/ropenscilabs/conditionz/coverage.svg?branch=master)](https://codecov.io/github/ropenscilabs/conditionz?branch=master) [![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/conditionz)](https://github.com/metacran/cranlogs.app) control how many times conditions are thrown Package API: - `handle_messages` - `handle_conditions` - `ConditionKeeper` - `handle_warnings` - `capture_message` - `capture_warning` Use cases for `conditionz` functions: - `ConditionKeeper` is what you want to use if you want to keep track of conditions inside a function being applied many times, either in a for loop or lapply style fashion. - `handle_conditions`/`handle_messages`/`handle_warnings` is what you want to use if the multiple conditions are happening within a single function or code block - `capture_message`/`capture_warning` are meant for capturing messages/warnings into a useable list ## Installation The CRAN version: ```r install.packages("conditionz") ``` Or the development version: ```r install.packages("devtools") devtools::install_github("ropenscilabs/conditionz") ``` ```r library("conditionz") ``` ## ConditionKeeper `ConditionKeeper` is the internal R6 class that handles keeping track of conditions and lets us determine if conditions have been encountered, how many times, etc. ```r x <- ConditionKeeper$new(times = 4) x #> ConditionKeeper #> id: 6824b49c-be8f-4ba1-9acc-47115b6bccbb #> times: 4 #> messages: 0 x$get_id() #> [1] "6824b49c-be8f-4ba1-9acc-47115b6bccbb" x$add("one") x$add("two") x #> ConditionKeeper #> id: 6824b49c-be8f-4ba1-9acc-47115b6bccbb #> times: 4 #> messages: 2 #> one two x$thrown_already("one") #> [1] TRUE x$thrown_already("bears") #> [1] FALSE x$not_thrown_yet("bears") #> [1] TRUE x$add("two") x$add("two") x$add("two") x$thrown_times("two") #> [1] 4 x$thrown_enough("two") #> [1] TRUE x$thrown_enough("one") #> [1] FALSE ``` ## basic usage A simple function that throws messages ```r squared <- function(x) { stopifnot(is.numeric(x)) y <- x^2 if (y > 20) message("woops, > than 20! check your numbers") return(y) } foo <- function(x) { vapply(x, function(z) squared(z), numeric(1)) } bar <- function(x, times = 1) { y <- ConditionKeeper$new(times = times) on.exit(y$purge()) vapply(x, function(z) y$handle_conditions(squared(z)), numeric(1)) } ``` Running the function normally throws many messages ```r foo(1:10) #> woops, > than 20! check your numbers #> woops, > than 20! check your numbers #> woops, > than 20! check your numbers #> woops, > than 20! check your numbers #> woops, > than 20! check your numbers #> woops, > than 20! check your numbers #> [1] 1 4 9 16 25 36 49 64 81 100 ``` Using in `ConditionKeeper` allows you to control how many messages are thrown ```r bar(x = 1:10) #> woops, > than 20! check your numbers #> [1] 1 4 9 16 25 36 49 64 81 100 ``` ```r bar(1:10, times = 3) #> woops, > than 20! check your numbers #> #> woops, > than 20! check your numbers #> #> woops, > than 20! check your numbers #> [1] 1 4 9 16 25 36 49 64 81 100 ``` ## benchmark definitely need to work on performance ```r library(microbenchmark) microbenchmark::microbenchmark( normal = suppressMessages(foo(1:10)), with_conditionz = suppressMessages(bar(1:10)), times = 100 ) #> Unit: microseconds #> expr min lq mean median uq max #> normal 857.006 874.4165 989.1222 900.992 943.1775 2796.801 #> with_conditionz 1906.543 1947.7495 2078.4096 1998.475 2132.5750 2729.156 #> neval #> 100 #> 100 ``` ## Meta * Please [report any issues or bugs](https://github.com/ropenscilabs/conditionz/issues). * License: MIT * Get citation information for `conditionz` in R doing `citation(package = 'conditionz')` * Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. [![rofooter](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org) conditionz/MD50000644000176200001440000000204313460052167012745 0ustar liggesusers1e619231edafac171c19233f882b1cdc *DESCRIPTION de9532c5aeb8082a5fc9cbee02186d6f *LICENSE 44046baf6d347da8a6f11da727888fbe *NAMESPACE a8fa1ba756d2cee9a515f07e5ce382c1 *NEWS.md 243cfb30a21510a73ea8855e5c57b46a *R/ConditionKeeper.R 7f40d06ca91153dfbeae3b3bc4d0e6f3 *R/capture_condition.R 2474dccd67df85724409b542fa56824e *R/conditionz-package.R 487f7880491abbeeecd04554207db97f *R/handle_conditions.R 22dcc505e79bafb70f7bfd30fac9e22c *R/zzz.R 2665582011c76050d7d9b25e319e6bda *README.md 069caf6354733d9d4c97bd75334e75aa *man/ConditionKeeper.Rd 462c105beb053909808911358ada560d *man/capture_condition.Rd 22e4a61da243c909915f09180e44e473 *man/conditionz-package.Rd 50bbdb06225e463207747fd3a4102168 *man/handle_conditions.Rd 5a98ac57fff040160bd13c73f4970e31 *tests/test-all.R 6db35026bcf023929fdcfcc44375f1fc *tests/testthat/test-ConditionKeeper.R 628afaf1b7168a1c4e0b86a9e0867b57 *tests/testthat/test-capture_message.R be7b22e8f0df74b6bcbe29a9fc53828d *tests/testthat/test-capture_warning.R 46634cf14857539f88e065e65a5d24e0 *tests/testthat/test-handle_conditions.R conditionz/DESCRIPTION0000644000176200001440000000206513460052167014147 0ustar liggesusersPackage: conditionz Title: Control How Many Times Conditions are Thrown Description: Provides ability to control how many times in function calls conditions are thrown (shown to the user). Includes control of warnings and messages. Version: 0.1.0 Authors@R: c( person("Scott", "Chamberlain", role = c("aut", "cre"), email = "myrmecocystus@gmail.com", comment = c(ORCID = "0000-0003-1444-9135"))) License: MIT + file LICENSE URL: https://github.com/ropenscilabs/conditionz BugReports: http://github.com/ropenscilabs/conditionz/issues Encoding: UTF-8 Depends: R(>= 3.2.1) Imports: R6, uuid Suggests: testthat RoxygenNote: 6.1.1 X-schema.org-applicationCategory: Utilities X-schema.org-keywords: condition, condition-control, warning, message X-schema.org-isPartOf: https://ropensci.org NeedsCompilation: no Packaged: 2019-04-11 16:31:35 UTC; sckott Author: Scott Chamberlain [aut, cre] () Maintainer: Scott Chamberlain Repository: CRAN Date/Publication: 2019-04-24 12:20:07 UTC conditionz/man/0000755000176200001440000000000013453665747013231 5ustar liggesusersconditionz/man/capture_condition.Rd0000644000176200001440000000100313402564653017207 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/capture_condition.R \name{capture_message} \alias{capture_message} \alias{capture_warning} \alias{capture_condition} \title{capture condition} \usage{ capture_message(expr) capture_warning(expr) } \description{ capture condition } \examples{ foom <- function(x) { message("its too bad") return(x) } capture_message(foom(4)) foow <- function(x) { warning("its too bad") return(x) } capture_warning(foow(4)) } \keyword{internal} conditionz/man/handle_conditions.Rd0000644000176200001440000000232713453500615017166 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/handle_conditions.R \name{handle_conditions} \alias{handle_conditions} \alias{handle_messages} \alias{handle_warnings} \title{Handle conditions} \usage{ handle_conditions(expr, condition = "message", times = 1) handle_messages(expr, times = 1) handle_warnings(expr, times = 1) } \arguments{ \item{expr}{an expression} \item{condition}{(character) one of "message" or "warning"} \item{times}{(integer) max. times a condition should be thrown. default: 1} } \value{ whatever the \code{expr} returns } \description{ Handle conditions } \details{ Uses \link{ConditionKeeper} internally } \examples{ foo <- function(x) { message("you gave: ", x) return(x) } foo('a') capture_message(foo('a')) handle_conditions(foo('a')) suppressMessages(handle_conditions(foo('a'))) handle_conditions(foo('a'), "message") bar <- function(x) { for (i in x) message("you gave: ", i) return(x) } bar(1:5) handle_conditions(bar(1:5)) handle_messages(foo('a')) hello <- function(x) { warning("you gave: ", x) return(x) } handle_warnings(hello('a')) # code block handle_warnings({ as.numeric(letters[1:3]) as.numeric(letters[4:6]) as.numeric(letters[7:9]) }) } conditionz/man/conditionz-package.Rd0000644000176200001440000000054713402343745017260 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/conditionz-package.R \docType{package} \name{conditionz-package} \alias{conditionz-package} \alias{conditionz} \title{condition control} \description{ condition control } \author{ Scott Chamberlain \href{mailto:myrmecocystus@gmail.com}{myrmecocystus@gmail.com} } \keyword{package} conditionz/man/ConditionKeeper.Rd0000644000176200001440000000347713453500615016573 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ConditionKeeper.R \docType{data} \name{ConditionKeeper} \alias{ConditionKeeper} \title{ConditionKeeper} \arguments{ \item{times}{(integer) number of times to throw condition. required. default: 1} \item{condition}{(character) which condition, one of "message" (default) or "warning"} } \description{ ConditionKeeper } \details{ \strong{Methods} \itemize{ \item \code{add(x)} - add a condition to internal storage \item \code{remove()} - remove the first condition from internal storage; returns that condition so you know what you removed \item \code{purge()} - removes all conditions \item \code{thrown_already(x)} - (return: logical) has the condition been thrown already? \item \code{not_thrown_yet(x)} - (return: logical) has the condition NOT been thrown yet? \item \code{thrown_times(x)} - (return: numeric) number of times the condition has been thrown \item \code{thrown_enough(x)} - (return: logical) has the condition been thrown enough? "enough" being: thrown number of times equal to what you specified in the \code{times} parameter \item \code{get_id()} - get the internal ID for the ConditionKeeper object \item \code{handle_conditions(expr)} - pass a code block or function and handle conditions within it } } \examples{ x <- ConditionKeeper$new(times = 4) x x$get_id() x$add("one") x$add("two") x x$thrown_already("one") x$thrown_already("bears") x$not_thrown_yet("bears") x$add("two") x$add("two") x$add("two") x$thrown_times("two") x$thrown_enough("two") x$thrown_enough("one") foo <- function(x) { message("you gave: ", x) return(x) } foo('a') x$handle_conditions(foo('a')) x <- ConditionKeeper$new(times = 4, condition = "warning") x x$add("one") x$add("two") x } \seealso{ \code{\link[=handle_conditions]{handle_conditions()}} } \keyword{datasets} conditionz/LICENSE0000644000176200001440000000005713453157206013447 0ustar liggesusersYEAR: 2019 COPYRIGHT HOLDER: Scott Chamberlain