Menyetel, membatalkan penyetelan, atau menanyakan tanda debug pada suatu fungsi. Argumen teks dan kondisi sama dengan argumen yang dapat diberikan melalui panggilan ke browser. Mereka dapat diambil oleh pengguna setelah browser dimasukkan, dan menyediakan mekanisme yang memungkinkan pengguna mengidentifikasi breakpoint mana yang telah diaktifkan.
debug(fun, text = "", condition = NULL, signature = NULL)
debugonce(fun, text = "", condition = NULL, signature = NULL)
undebug(fun, signature = NULL)
isdebugged(fun, signature = NULL)
debuggingState(on = NULL)
| Parameter | Deskripsi |
|---|---|
fun |
any interpreted R function. |
text |
a text string that can be retrieved when the browser is entered. |
condition |
a condition that can be retrieved when the browser is entered. |
signature |
an optional method signature. If specified, the method is debugged, rather than its generic. |
on |
logical; a call to the support function debuggingState returns TRUE if debugging is globally turned on, FALSE otherwise. An argument of one or the other of those values sets the state. If the debugging state is FALSE, none of the debugging actions will occur (but explicit browser calls in functions will continue to work). |
# NOT RUN {
debug(library)
library(methods)
# }
# NOT RUN {
debugonce(sample)
## only the first call will be debugged
sampe(10, 1)
sample(10, 1)
# }