[R] comment() a function

Robin Hankin rksh at soc.soton.ac.uk
Tue Apr 27 09:48:59 CEST 2004

Hi everyone.

I want to comment() a function f(), and I know it's there
because comment(f) returns the comment as expected...but dput() does not
print the the comment.   dput() prints
comments for other types of objects. What's wrong with my understanding here?

f <- function(x){x^2}
comment(f) <- "works fine"
[1] "works fine"

why hasn't dput() printed the comment?
How can I save a function onto disk with a comment()?

Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
initialDOTsurname at soc.soton.ac.uk (edit in obvious way; spam precaution)

More information about the R-help mailing list