[Rd] Unable to reload Rdoc

Henrik Bengtsson hb at biostat.ucsf.edu
Fri Jan 27 22:29:57 CET 2012


Related: To simplify reloading a help page after restarting R, I do
have the following in my ~/.Rprofile:

# Always only the HTML help on the same port
local({
  port <- sum(c(1e3,10)*as.double(R.Version()[c("major", "minor")]));
  ports <- 10*port + 0:9;
  options(help.ports=ports);
});

# Try to start HTML help server
tryCatch({
  if (interactive()) {
    tools::startDynamicHelp();
  }
}, error = function(ex) {
  print(ex);
})

That way the URL for the help page remain the same (as long as you
only run one R session) and the internal web server is up and running
(no need for help.start()).

My $.02

/Henrik

On Fri, Jan 27, 2012 at 6:15 AM, Hadley Wickham <hadley at rice.edu> wrote:
> On Fri, Jan 27, 2012 at 3:47 AM, Mark Cowley <m.cowley at garvan.org.au> wrote:
>> Dear list,
>> I'm hoping the R guru's can help with an error i've been getting for at least a year during active package development.
>>
>> I have a package loaded & spot a documentation bug, so I:
>> edit the Rd file (or in the roxygen header + roxygenize); then
>> R CMD BUILD,
>> R CMD INSTALL
>> then in the same R session, reload the library & lookup a man page, I always get this error:
>> Error in fetch(key) : internal error -3 in R_decompress1
>>
>> I've tried all ways of reloading the package that i'm aware of:
>> detach then library
>> unloadNamespace then library
>> devtools::install
>> devtools::reload
>>
>> all lead to the error.
>>
>> I see from ?detach:
>> ... So detaching and re-attaching a package may
>> not refresh some or all components of the package, and is
>> inadvisable.
>>
>> restarting the R session results in loading the updated man file, but do you have any ideas how to word around this & continue within the same R session?
>>
>> cheers,
>> Mark
>>
>> # 1) using Hadley's devtools
>>> library(devtools)
>>> library(updateR) # my package under development
>>> install("~/src/R/updateR")
>
> To avoid this problem, the latest version of devtools has show_rd(),
> which allows you to preview an Rd file in R without having to
> reinstall the package.  This was actually really simple to implement,
> and I don't know why I didn't think of it ages ago - it's certainly
> made my workflow much smoother.
>
> Hadley
>
> --
> Assistant Professor / Dobelman Family Junior Chair
> Department of Statistics / Rice University
> http://had.co.nz/
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list