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. > library("R.devices") R.devices v2.17.3 successfully loaded. See ?R.devices for help. > > message("*** capturePlot() ...") *** capturePlot() ... > > cat("Default graphics device:\n") Default graphics device: > str(getOption("device")) function (file = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf", width, height, onefile, family, title, fonts, version, paper, encoding, bg, fg, pointsize, pagecentre, colormodel, useDingbats, useKerning, fillOddEven, compress, timestamp, producer, author) > > message("*** capturePlot() - as.architecture() ...") *** capturePlot() - as.architecture() ... > > path <- system.file("exdata", package="R.devices") > pattern <- "^capturePlot,.*[.]rds$" > pathnames <- dir(path=path, pattern=pattern, full.names=TRUE) > > for (kk in seq_along(pathnames)) { + pathname <- pathnames[kk] + message(sprintf("- File #%d ('%s') ...", kk, pathname)) + + g <- readRDS(pathname) + arch <- architecture(g) + str(arch) + + ## Currently, as.architecture() cannot coerce endianess + if (arch$endian == .Platform$endian) { + ## Currently, as.architecture() cannot change pointer size + # if (arch$ptrsize == .Machine$sizeof.pointer) { + g8_1 <- as.architecture(g, ptrsize=8L) + arch8_1 <- architecture(g8_1) + str(arch8_1) + + g8_1b <- as.architecture(g8_1, ptrsize=8L) + arch8_1b <- architecture(g8_1b) + str(arch8_1b) + stopifnot(identical(arch8_1b, arch8_1)) + stopifnot(identical(g8_1b, g8_1)) + + g4_1 <- as.architecture(g8_1, ptrsize=4L) + arch4_1 <- architecture(g4_1) + str(arch4_1) + + g8_2 <- as.architecture(g4_1, ptrsize=8L) + arch8_2 <- architecture(g8_2) + str(arch8_2) + stopifnot(identical(g8_2, g8_1)) + + g_2 <- as.architecture(g) + arch_2 <- architecture(g_2) + str(arch_2) + + if (getRversion() >= "3.3.0") { + try(replayPlot(g_2)) + } + # } ## if (arch$ptrsize == .Machine$sizeof.pointer) + } ## if (arch$endian == .Platform$endian) + } ## for (kk ...) - File #1 ('D:/RCompile/CRANincoming/R-devel/lib/R.devices/exdata/capturePlot,engine=11,ostype=unix,arch=i686,ptrsize=4,endian=little.rds') ... List of 4 $ ostype : chr "unix" $ arch : chr "i686" $ ptrsize: int 4 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 4 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" Error in value[[3L]](cond) : invalid "recordedplot": too few arguments In addition: Warning messages: 1: In restoreRecordedPlot(x, reloadPkgs) : snapshot recorded in different R version (3.3.1) 2: In doTryCatch(return(expr), name, parentenv, handler) : snapshot recorded with different graphics engine version (11 - this is version 17) - File #2 ('D:/RCompile/CRANincoming/R-devel/lib/R.devices/exdata/capturePlot,engine=11,ostype=unix,arch=x86_64,ptrsize=8,endian=little.rds') ... List of 4 $ ostype : chr "unix" $ arch : chr "x86_64" $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 4 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "unix" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" Error in value[[3L]](cond) : invalid "recordedplot": too few arguments In addition: Warning messages: 1: In restoreRecordedPlot(x, reloadPkgs) : snapshot recorded in different R version (3.3.1) 2: In doTryCatch(return(expr), name, parentenv, handler) : snapshot recorded with different graphics engine version (11 - this is version 17) - File #3 ('D:/RCompile/CRANincoming/R-devel/lib/R.devices/exdata/capturePlot,engine=11,ostype=windows,arch=i386,ptrsize=4,endian=little.rds') ... List of 4 $ ostype : chr "windows" $ arch : chr "i386" $ ptrsize: int 4 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 4 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" Error in value[[3L]](cond) : invalid "recordedplot": too few arguments In addition: Warning messages: 1: In restoreRecordedPlot(x, reloadPkgs) : snapshot recorded in different R version (3.3.1) 2: In doTryCatch(return(expr), name, parentenv, handler) : snapshot recorded with different graphics engine version (11 - this is version 17) - File #4 ('D:/RCompile/CRANincoming/R-devel/lib/R.devices/exdata/capturePlot,engine=11,ostype=windows,arch=x86_64,ptrsize=8,endian=little.rds') ... List of 4 $ ostype : chr "windows" $ arch : chr "x86_64" $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 4 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" List of 4 $ ostype : chr "windows" $ arch : chr NA $ ptrsize: int 8 $ endian : chr "little" Error in value[[3L]](cond) : invalid "recordedplot": too few arguments In addition: Warning messages: 1: In restoreRecordedPlot(x, reloadPkgs) : snapshot recorded in different R version (3.3.1) 2: In doTryCatch(return(expr), name, parentenv, handler) : snapshot recorded with different graphics engine version (11 - this is version 17) > > message("*** capturePlot() - as.architecture() ... DONE") *** capturePlot() - as.architecture() ... DONE > > message("*** capturePlot() - capture and replay ...") *** capturePlot() - capture and replay ... > > if (getRversion() >= "3.3.0") { + message("- capture") + g <- capturePlot({ + plot(1:10) + }) + + message("- system information") + system <- attr(g, "system") + print(system) + + message("- saving") + ## Record for troubleshooting + tags <- sprintf("%s=%s", names(system), system) + pathname <- sprintf("capturePlot,%s.rds", paste(tags, collapse=",")) + saveRDS(g, file=pathname) + + message("- architecture") + print(architecture(g)) + + message("- replay") + ## Replay + replayPlot(g) + + message("- display") + ## Display + print(g) + + message("- toDefault()") + ## Display with a 2/3 aspect ratio + toDefault(aspectRatio=2/3, print(g)) + + message("- devEval()") + ## Redraw to many output formats + devEval(c("{png}", "{eps}", "{pdf}"), aspectRatio=2/3, print(g)) + + } ## if (getRversion() >= "3.3.0") - capture - system information $ostype [1] "windows" $arch [1] "x86_64" $ptrsize [1] 8 $endian [1] "little" - saving - architecture $ostype [1] "windows" $arch [1] "x86_64" $ptrsize [1] 8 $endian [1] "little" - replay - display - toDefault() - devEval() $png [1] "figures/Rplot.png" $eps [1] "figures/Rplot.eps" $pdf [1] "figures/Rplot.pdf" > > message("*** capturePlot() - capture and replay ... DONE") *** capturePlot() - capture and replay ... DONE > > message("*** capturePlot() ... DONE") *** capturePlot() ... DONE > > proc.time() user system elapsed 0.73 0.15 1.56