Re: [Rd] Unable to reload Rdoc

From: Mark Cowley <m.cowley_at_garvan.org.au>
Date: Mon, 30 Jan 2012 10:23:52 +1100

Gentlemen,
Thanks for your insights, all 3 hints are very useful.

Mark
On 28/01/2012, at 8:29 AM, Henrik Bengtsson wrote:

> 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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 29 Jan 2012 - 23:29:44 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 30 Jan 2012 - 03:10:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive