Skip to content
Prev 316731 / 398506 Next

Question: write an R script with help information available to the user

On Sat, Feb 2, 2013 at 6:31 PM, Chee Chen <chen418 at purdue.edu> wrote:
You may wish to create a package from your script; however, if you
would prefer not then a workaround would be to redefine the ? function
in your script to provide some help.  For example if you had this line
in your script:

`?` <- function(...) if (match.call()[[2]] == "mytopic")
cat("whatever\n") else help(...)

then this would work:
whatever
where the last line launches normal help.  If you wish to display a
file rather than cat strings to the console then use: file.show


--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com