Documenting a function: How to get the comments in a function similar to args()
Along the lines of Gabor's method, presumably you could put a "spare"
argument in your function:
foo<- function(x,help=FALSE,...)
{
helpout<-c(comment,
comment,
end of comments)
if(something_is_wrong_with_inputs || help=TRUE)
{
print(helpout)
stop #or trycatch, or whatever you prefer
}
[remainder of function]
}
I know that's sloppy but I'm new to R.
Carl