Skip to content
Prev 41943 / 63421 Next

R CMD <custom>?

It'd be cool if R CMD was user extensible through packages, so that (e.g.)

R CMD mypackage::mycommand

would do something like:

path <- system.file("cmd", paste(command, ".r"), package = package)
if (!file.exists(path)) {
  stop("Command ", command, " in ", package, " does not exist")
} else {
  source(path)
}

And maybe `R CMD mypackage` would look in mypackcage/cmd/default.r.

Hadley
On Mon, Nov 28, 2011 at 1:16 PM, Henrik Bengtsson <hb at biostat.ucsf.edu> wrote: