[ESS] ESS, devtools, and documentation

Vitalie Spinu spinuvit at gmail.com
Sun Oct 19 00:51:31 CEST 2014


 >>> Martin Maechler on Sat, 18 Oct 2014 10:30:58 +0200 wrote:

 > it was almost fine,  ... and I think it is more flexible to keep the
 > "global" .ess.helpFUN
 
 > For you, Timothy, or any other working with released ESS, a nicer
 > workaround should be to do -- once in your session -- so you could do
 > it on the same line in your R scripts where you have
 > require(devtools) {or library(..) if you really prefer} :

 >    .ess.helpFUN <- get("help", globalenv())

Due to lexical scope we are picking .ess.helpFUN from ESSR
environment. So the user has to assign it in ESSR.

.ess.helpFUN looks like a complication to me. If we pick "help" from
globalenv users can assign their own "help" function in globalenv if
they want so.

In my previous email I was particularly interested if the "glbalenv"
function is defined in very old version of R. Sorry for not being
explicit about that.

 > After all devtools wants to get the help page from the package source
 > without attaching the package to the search() path. So, the above
 > workaround does ensure regular help works for all packages you have
 > in search(), it will *not* find the help pages of the "load_all(.) --
 > pseudo attached package". Only if you additionally attach (a
 > typically older version of) your package {using require() or
 > library()}, you will get the (old version of) help pages for that
 > package.

Devtools redefines "help" function and it makes sure that the help from
dev-loaded packages is accessible. That should not be our concern. We
need to make sure that help(foo), print(help(foo)), ? and C-c C-v work
exactly the same and the only way to achieve that is to pick help from
globalenv.

 Vitalie



More information about the ESS-help mailing list