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. > getPathname <- R.devices:::getPathname > getPath <- R.devices:::getPath > view <- R.devices:::view > getData <- R.devices:::getData > > message("*** DevEvalFileProduct ...") *** DevEvalFileProduct ... > > # Return the DevEvalProduct object by default > R.devices::devOptions("*", field="*") > > message("*** DevEvalFileProduct - image file ...") *** DevEvalFileProduct - image file ... > > p <- R.devices::toEPS("foo", tags=c("a", "b"), aspectRatio=0.7, { + plot(1:10) + }) > print(p) [1] "figures/foo,a,b.eps" > str(p) 'DevEvalFileProduct' chr "figures/foo,a,b.eps" - attr(*, "type")= Named chr "eps" ..- attr(*, "names")= chr "eps" > > library("R.devices") > > fields <- c("name", "fullname", "filename", "pathname", "path", "mime", "dataURI") > for (ff in fields) { + cat(sprintf("%s: %s\n", ff, substring(p[[ff]], 1, 50))) + } name: foo fullname: foo,a,b filename: foo,a,b.eps pathname: figures/foo,a,b.eps path: figures mime: application/postscript dataURI: data:application/postscript;base64,JSFQUy1BZG9iZS0 > > pathnameA <- getPathname(p, relative=FALSE) > cat(sprintf("Absolute pathname: %s\n", pathnameA)) Absolute pathname: d:/RCompile/CRANincoming/R-devel/R.devices.Rcheck/tests/figures/foo,a,b.eps > path <- getPath(p, relative=FALSE) > cat(sprintf("Path: %s\n", path)) Path: d:/RCompile/CRANincoming/R-devel/R.devices.Rcheck/tests/figures > pathnameR <- getPathname(p, relative=TRUE) > cat(sprintf("Relative pathname: %s\n", pathnameR)) Relative pathname: figures/foo,a,b.eps > > data <- getData(p, mode="character") > str(data) chr "%!PS-Adobe-3.0 EPSF-3.0\r\n%%DocumentNeededResources: font Helvetica\r\n%%+ font Helvetica-Bold\r\n%%+ font Hel"| __truncated__ > > data <- getData(p, mode="raw") > str(data) raw [1:6702] 25 21 50 53 ... > > > ## Call view() but use void browser > view(p, browser="false") > > message("*** DevEvalFileProduct - image file ... DONE") *** DevEvalFileProduct - image file ... DONE > > message("*** DevEvalFileProduct - missing file ...") *** DevEvalFileProduct - missing file ... > > # An empty file product > na <- DevEvalFileProduct() > print(na) [1] "NA" > cat(sprintf("Pathname: %s\n", getPathname(na))) Pathname: NA > > message("*** DevEvalFileProduct - missing file ... DONE") *** DevEvalFileProduct - missing file ... DONE > > message("*** DevEvalFileProduct ... DONE") *** DevEvalFileProduct ... DONE > > proc.time() user system elapsed 0.48 0.15 0.92