[inlinedocs] Changes to source attribute in R-devel
Duncan Murdoch
murdoch.duncan at gmail.com
Tue Jul 12 02:51:51 CEST 2011
To the inlinedocs maintainers:
I'm writing to you to warn you about some changes planned for R 2.14.0
(to be released at the end of October) that affect your inlinedocs package.
We are changing the way function source is attached to functions, so
code like
attr(fun.obj, "source")
will no longer work. The following function should work in both
existing and upcoming versions:
getSource <- function(fun.obj) {
srcref <- attr(fun.obj, "srcref")
if (!is.null(srcref)) unlist(strsplit(as.character(srcref), "\n"))
else attr(fun.obj, "source")
}
(You may not need the unlist(strsplit(...)) code; it just gives you the
same result as your old code did. Without it there may be embedded
newlines in the result.)
Duncan Murdoch
More information about the Inlinedocs-support
mailing list