diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/CPar.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/CPar.java index 9880fdc91180ad613f46526d135946fd4210c28b..601b7cfe3280f6f288e0fa3b1ebe35cbd3bfb483 100644 --- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/CPar.java +++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/graphics/CPar.java @@ -158,6 +158,10 @@ public final class CPar extends RExternalBuiltinNode { case "page": // TODO: return RDataFactory.createLogicalVectorFromScalar(false); + case "xaxp": + case "yaxp": + // TODO: + return RDataFactory.createDoubleVector(new double[]{0., 1., 5.}, RDataFactory.COMPLETE_VECTOR); default: if (!FastROptions.IgnoreGraphicsCalls.getBooleanValue()) { throw RError.nyi(RError.NO_CALLER, "C_Par parameter '" + name + "'"); 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 1167d18fa09e150f0d48090c88e579ed27bdaeb4..9cde5b5e91597afe621f622648bf6936854eece1 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 @@ -25,7 +25,7 @@ # prints a warning message instructing the user to use grid/lattice/ggplot2 instead eval(expression({ - graphicsWarning <- function(name) { + graphicsWarning <- function(name, ignore = NULL) { # lookup original function and fetch signature fun <- tryCatch(get(name, environment()), error=function(x) NULL) if(!is.null(fun)) { @@ -36,7 +36,11 @@ eval(expression({ if (.fastr.option('IgnoreGraphicsCalls')) { # we evaluate the arguments to simulate the function effects - replacementFun <- function(...) { if (is.null(sig)) list(...) else get(names(sig)); invisible(NULL); } + # some arguments must be ignored, because they are a promise + # to value that will be calculated inside the function before + # the argument is accessed + sigNames <- setdiff(base::names(sig), ignore) + replacementFun <- function(...) { if (is.null(sigNames)) list(...) else mget(sigNames, ifnotfound=as.list(rep(42, length(sigNames)))); invisible(NULL); } } else { 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.")) @@ -98,7 +102,7 @@ eval(expression({ } # Note: explicitly supported functions: din - # Note: harmless functions that we do not override: co.intervals, hist.default + # Note: harmless functions that we do not override: co.intervals, hist.default, axTicks # Note: S3 dispatch functions that may dispatch to lattice/ggplot2/etc. implementation: hist, contour, lines, pairs, points, text abline <- graphicsWarning("abline"); @@ -108,7 +112,6 @@ eval(expression({ Axis <- graphicsWarning("Axis"); axis.Date <- graphicsWarning("axis.Date"); axis.POSIXct <- graphicsWarning("axis.POSIXct"); - axTicks <- graphicsWarning("axTicks"); barplot.default <- graphicsWarning("barplot.default"); box <- graphicsWarning("box"); boxplot.default <- graphicsWarning("boxplot.default"); @@ -134,7 +137,7 @@ eval(expression({ layout <- graphicsWarning("layout"); layout.show <- graphicsWarning("layout.show"); lcm <- graphicsWarning("lcm"); - legend <- graphicsWarning("legend"); + legend <- graphicsWarning("legend", c('merge')); lines.default <- graphicsWarning("lines.default"); locator <- graphicsWarning("locator"); matlines <- graphicsWarning("matlines");