diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/R/fastrGraphics.R b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/R/fastrGraphics.R index 7a48a7b74ff0f825ec64cfedaa0e264e99931214..2ffbef80c874914e8e0457462f1055a3f1d6ed33 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/R/fastrGraphics.R +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/R/fastrGraphics.R @@ -26,10 +26,23 @@ eval(expression({ graphicsWarning <- function(name) { - function(...) { + # lookup original function and fetch signature + fun <- tryCatch(get(name, environment()), error=function(x) NULL) + if(!is.null(fun)) { + sig <- formals(fun) + } else { + sig <- NULL + } + + replacementFun <- function(...) { warning(paste0(name, " not supported.", " Note: FastR does not support graphics package and most of its functions. Please use grid package or grid based packages like lattice instead.")) NULL } + + if(!is.null(sig)) { + formals(replacementFun) <- sig + } + return(replacementFun) } plot.default <- function (x, y = NULL, type = "p", xlim = NULL, ylim = NULL,