[Rd] help.start() only recognizes forward slashes in R_LIBS_USER which is not the default case

Henrik Bengtsson hb at stat.berkeley.edu
Tue Oct 27 05:05:05 CET 2009

I've found that the HTML help system started via help.start() requires
all forward slashes in R_LIBS_USER otherwise the Packages page is
corrupt/non-working.  Note that by default R_LIBS_USER is set by R on

Example 1:
With R_LIBS_USER=C:/Users/JohnDoe/R/win-library/2.10
> help.start() [and go to "Packages"]
If nothing happens, you should open
'' yourself
This works!

Example 2:
With: R_LIBS_USER=C:\\Users\\JohnDoe\\R\\win-library\\2.10
> help.start() [and go to "Packages"]
If nothing happens, you should open
'' yourself
Warning message:
In sub(paste(lib, "([^/]*)", "DESCRIPTION$", sep = "/"), "\\1",  :
  regcomp error:  'Invalid back reference'
> Making packages.html ...

with displaying:

Error in sub(paste(lib, "([^/]*)", "DESCRIPTION$", sep = "/"), "\\1",  :
  invalid regular expression

Example 3:
With R_LIBS_USER=C:\\Users\\JohnDoe/R/win-library/2.10
> help.start() [and go to "Packages"]
If nothing happens, you should open
'' yourself

with displaying:

Packages in C:\Users\JohnDoe\R\win-library\2.10

C:\Users\JohnDoe/R/win-library/2.10/abind/DESCRIPTION	-- Title is missing --
C:\Users\JohnDoe/R/win-library/2.10/affxparser/DESCRIPTION	-- Title is
missing --
C:\Users\JohnDoe/R/win-library/2.10/affy/DESCRIPTION	-- Title is missing --

where the abind link is
and similarly for affxparser and so on.

This third case may(?)/is(?) set by R on startup if R_LIBS_USER is not
set, cf. help(.libPaths):

     By default 'R_LIBS' is unset, and 'R_LIBS_USER' is set to
     subdirectory 'R/win-library/x.y' of the home directory, for R

because HOME=C:\Users\JohnDoe is set by Windows.

It seems like the HTML help server only recognizes forward slashes in

The following patch solves the problem (can be added to ~/.Rprofile):

.libPaths(gsub("\\", "/", .libPaths(), fixed=TRUE));


> sessionInfo()
R version 2.10.0 Patched (2009-10-26 r50212)

[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.10.0

More information about the R-devel mailing list