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 Oct. 30, 2019, 10:58 a.m.