tests/dataURI.R

message("*** dataURI ...")

R.devices::devOptions("*", field="dataURI")
uri <- R.devices::toPNG("foo", tags=c("a", "b"), aspectRatio=0.7, {
  plot(1:10)
})
str(uri)


R.devices::devOptions("*", field="pathname")
png <- R.devices::toPNG("foo", tags=c("a", "b"), aspectRatio=0.7, {
  plot(1:10)
}, force=FALSE)
uri2 <- R.devices::asDataURI(png)
str(uri2)
stopifnot(identical(uri2, uri))

message("*** dataURI ... DONE")

Try the R.devices package in your browser

Any scripts or data that you put into this service are public.

R.devices documentation built on June 21, 2022, 9:06 a.m.