tests/toNNN.R

library("R.devices")

message("*** toNnn() ...")

## Get all toNnn() functions
envir <- getNamespace("R.devices")
names <- ls(pattern="^to", envir=envir)
fcns <- list()
for (name in names) {
  if (exists(name, envir=envir, mode="function")) {
    fcns[[name]] <- get(name, envir=envir, mode="function")
  }
}

for (name in names(fcns)) {
  message(sprintf("*** %s() ...", name))
  toFcn <- fcns[[name]]
  tryCatch({
    toFcn(name=name, { plot(1:10) })
  }, error = function(ex) {
    print(ex)
  })
  message(sprintf("*** %s() ... DONE", name))
}

## FIXME:
graphics.off()

message("*** toNnn() ... 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.