From hadley at rice.edu  Fri Jan 27 15:15:45 2012
From: hadley at rice.edu (Hadley Wickham)
Date: Fri, 27 Jan 2012 08:15:45 -0600
Subject: [Rd] Unable to reload Rdoc
In-Reply-To: <5E2DFDD7-D68B-4B8B-915F-2ACFC08C4D94@garvan.org.au>
References: <5E2DFDD7-D68B-4B8B-915F-2ACFC08C4D94@garvan.org.au>
Message-ID: <CABdHhvHYxxAuxpxEQJb5ztrbUs7pwWZZvBPACO3MTzidjwEy0g@mail.gmail.com>

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/



[Rd] Unable to reload Rdoc
Hadley Wickham