#..................................................................
#
# Esta unidad funciona MAL
#
# NO USAR DE MOMENTO, la idea está ahí pero no consigo generalizarla bien
#
#..................................................................
.test.get.fun.name <- function(exclude.print = TRUE, DEBUG = F) {
print(.get.fun.name(exclude.print=exclude.print,DEBUG = DEBUG))
}
.get.fun.name <- function(exclude.print = TRUE, DEBUG = FALSE) {
callingFun = as.list(sys.call(-1))[[1]]
calledFun = as.list(sys.call())[[1]]
print(callingFun)
if (exclude.print & callingFun == "print") callingFun = as.list(sys.call(-2))[[1]]
# callingFun <- deparse(callingFun)
# if(is.list(callingFun) | is.call(callingFun)) {
# # callingFun <- callingFun[[3]]
#
# }
if(DEBUG) {
print(class(callingFun))
message(paste(deparse(callingFun), " is calling ", calledFun, sep=""))
}
return(callingFun)
# args <- formals(.current.call)
# args$... <- NULL
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.