calledBy | R Documentation |
Determines whether the current function call was initiated by a specified function. This is useful for conditional behavior depending on the caller.
calledBy(fun = "exams2pdf")
called_by(fun = "exams2pdf")
fun |
Character string specifying the name of the calling function to check for.
Defaults to |
A logical value: TRUE
if the current call was triggered by fun
, otherwise FALSE
.
funB <- function() { calledBy("funA") }
funA <- function() { funB() }
funA() # Returns TRUE because funB was called by funA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.