An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20120127/da0ad921/attachment.pl>
Unable to reload Rdoc
5 messages · Mark Cowley, Brian Ripley, Hadley Wickham +1 more
This is simply not supported. Lazy-load databases are cached, and you cannot expect to change them during the R session once they have been used. Spend the few milliseconds needed to start a new session. And R CMD Rdconv is a much simpler way to check a changed .Rd file.
On 27/01/2012 09:47, Mark Cowley 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.
You were warned ....
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")
install("~/src/R/updateR")
Installing updateR * checking for file ?/Users/marcow/src/R/updateR/DESCRIPTION? ... OK * preparing ?updateR?: * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files * checking for empty or unneeded directories * building ?updateR_1.0.4.tar.gz? Warning in normalizePath(c(new, .Library.site, .Library), "/") : path[3]="": No such file or directory * installing *source* package ?updateR? ... ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ... ** testing if installed package can be loaded * DONE (updateR) Reloading installed updateR
?get.full.path
Error in fetch(key) : internal error -3 in R_decompress1
2) using detach + library
$ R --vanilla
library(updateR)
# ?list.my.packages
detach(pos=2, unload=TRUE, force=TRUE)
#<<make a change to an Rd file>>
system("cd ~/src/R&& R CMD BUILD updateR&& R CMD INSTALL updateR")
library("updateR")
?list.my.packages
Error in fetch(key) : internal error -3 in R_decompress1
3) using unloadNamespace
$ R --vanilla
library(updateR)
# ?list.my.packages
unloadNamespace("updateR")
#<<make a change to an Rd file>>
system("cd ~/src/R&& R CMD BUILD updateR&& R CMD INSTALL updateR")
library("updateR")
?list.my.packages
Error in fetch(key) : internal error -3 in R_decompress1
sessionInfo()
R version 2.13.1 (2011-07-08) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_AU.UTF-8/en_AU.UTF-8/C/C/en_AU.UTF-8/en_AU.UTF-8 attached base packages: [1] tools stats graphics grDevices datasets utils methods [8] base other attached packages: [1] updateR_1.0.4 codetools_0.2-8 devtools_0.4 loaded via a namespace (and not attached): [1] RCurl_1.6-7 ----------------------------------------------------- Mark Cowley, PhD Pancreatic Cancer Program | Peter Wills Bioinformatics Centre Garvan Institute of Medical Research, Sydney, Australia ----------------------------------------------------- [[alternative HTML version deleted]]
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
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/
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
2 days later
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