R Under development (unstable) (2025-12-16 r89184 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > message("*** devIsInteractive() ...") *** devIsInteractive() ... > > library("R.devices") R.devices v2.17.3 successfully loaded. See ?R.devices for help. > > types <- list(c(), "png", "x11", c("png", "jpeg", "png", "x11"), x11, png) > for (types in types) { + print(types) + res <- devIsInteractive(types) + print(res) + stopifnot(is.logical(res)) + stopifnot(is.character(names(res))) + stopifnot(length(res) == length(types)) + if (is.character(types)) stopifnot(all(names(res) == types)) + } NULL named logical(0) [1] "png" png FALSE [1] "x11" x11 TRUE [1] "png" "jpeg" "png" "x11" png jpeg png x11 FALSE FALSE FALSE TRUE function (display = "", width, height, pointsize, gamma, bg, canvas, fonts, family, xpos, ypos, title, type, antialias, symbolfamily) { if (is.numeric(display) && missing(height) && (missing(width) || is.numeric(width))) { warning(gettextf("Calls like '%s' are unsafe and should be replaced by '%s'", "x11(w, h)", "x11(width=w, height=h)"), domain = NA) if (!missing(width)) height <- width width <- display } windows(width = width, height = height, pointsize = pointsize, bg = bg, gamma = gamma, xpos = xpos, ypos = ypos, title = title) } X11 TRUE function (filename = "Rplot%03d.png", width = 480, height = 480, units = "px", pointsize = 12, bg = "white", res = NA, family = "sans", restoreConsole = TRUE, type = c("windows", "cairo", "cairo-png"), antialias = c("default", "none", "cleartype", "gray", "subpixel"), symbolfamily = "default") { if (!checkIntFormat(filename)) stop("invalid 'filename'") g <- .geometry(width, height, units, res) if (match.arg(type) == "cairo") { antialias <- match(match.arg(antialias), aa.cairo) invisible(.External(C_devCairo, filename, 2L, g$width, g$height, pointsize, bg, res, antialias, 100L, if (nzchar(family)) family else "sans", 300, chooseSymbolFont(symbolfamily))) } else if (match.arg(type) == "cairo-png") { antialias <- match(match.arg(antialias), aa.cairo) invisible(.External(C_devCairo, filename, 5L, g$width, g$height, pointsize, bg, res, antialias, 100L, if (nzchar(family)) family else "sans", 300, chooseSymbolFont(symbolfamily))) } else { new <- if (!missing(antialias)) { list(bitmap.aa.win = match.arg(antialias, aa.win)) } else list() antialias <- check.options(new = new, envir = .WindowsEnv, name.opt = ".Windows.Options", reset = FALSE, assign.opt = FALSE)$bitmap.aa.win invisible(.External(C_devga, paste0("png:", filename), g$width, g$height, pointsize, FALSE, 1L, NA_real_, NA_real_, bg, 1, as.integer(res), NA_integer_, FALSE, .PSenv, NA, restoreConsole, "", FALSE, TRUE, family, match(antialias, aa.win))) } } FALSE > > message("*** devIsInteractive() ... DONE") *** devIsInteractive() ... DONE > > proc.time() user system elapsed 0.37 0.12 0.48