somefunction <- function (...)
{
k <- length(ll <- list(...))
if (k == 0L)
return(invisible())
mc <- match.call()
for (i in 1L:k) if (!(is.logical(r <- ll[[i]]) && !any(is.na(r)) &&
all(r))) {
ch <- deparse(mc[[i + 1]], width.cutoff = 60L)
if (length(ch) > 1L)
ch <- paste(ch[1L], "....")
stop(paste(ch, " is not ", if (length(r) > 1L)
"all ", "TRUE", sep = ""), call. = FALSE)
}
invisible()
}Main Tools
traceback()- the sequence of calls that led to the error- runs after you’ve gotten the error
- Setting breakpoints
browser()- open an interactive session at an arbitrary breakpoint- can be used to create conditional breakpoints
debug()- open an interactive session where the error occurred- RStudio has a
rerun with debugoption
- RStudio has a
