In RStudio, calling View() on a memoised function does not take you to the original function's source. On the one hand this makes it very clear to the user that their function is doing special stuff; on the other it can be a pain during development. This behaviour could be changed, e.g. as follows:
View <- function(x, title) {
if (memoise::is.memoised(x)) {
x <- environment(x)[["_f"]]
}
eval(substitute(
get("View", envir = as.environment("package:utils"))(x, title)
))
}
In RStudio, calling
View()
on a memoised function does not take you to the original function's source. On the one hand this makes it very clear to the user that their function is doing special stuff; on the other it can be a pain during development. This behaviour could be changed, e.g. as follows: