Hi,
I need a bit of help installing Rpad.
My host runs redhat linux and I followed the instruction
given in http://www.rpad.org/Rpad/ServerNote.html. I was
clear for the most part. But I don't know what's going
on with the last step:
To update the javascript database for the R keyword
search page (SearchRKeywords.html), source makeHelpTemplate.R
from within R in the main Rpad directory.
Here's what I did:
$ R --silent --no-save
> source ('/bla/bla/bla/Rpad/inst/basehtml/makeHelpTemplate.R')
It returned:
Error in gzfile(file, "r") : cannot open the connection
In addition: Warning message:
In gzfile(file, "r") :
cannot open compressed file '', probable reason 'No such file or
directory'
Error in gzfile(file, "r") : cannot open the connection
This set of lines were repeated 9 or 10 times.
Here's makeHelpTemplate.R as it came in tar.gz format:
package.contents <- function (pkg, lib.loc = NULL)
{
file <- system.file("CONTENTS", package = pkg, lib.loc =
lib.loc)
# if (file == "") {
# warning(paste("Cannot find CONTENTS file of package",
# pkg))
# return(NA)
# }
read.dcf(file = file, fields = c("Entry", "Aliases",
"Keywords", "Description"))
# read.dcf(file = file)
}
makeIndexData <- function(lib.loc = rev(.libPaths()) ) {
res <- NULL
firstpg <- c("base","utils", "stats",
"graphics", "methods")
for (i in firstpg)
res <- rbind(res,package.contents(i))
for (lib in lib.loc) {
pg <- .packages(all.available=TRUE, lib.loc=lib)
pg <- pg[!(pg %in% firstpg)]
for (i in pg)
try(res <- rbind(res,package.contents(i)))
}
res
}
writeIndexData <- function(res) { # then must edit after
t <- file("helpIndex.txt","w")
cat(file=t,"var Entry =\n")
dput(res[,"Entry"],file=t)
cat(file=t,"var Keywords =\n")
dput(res[,"Keywords"],file=t)
cat(file=t,"var Aliases =\n")
dput(res[,"Aliases"],file=t)
cat(file=t,"var Description =\n")
dput(res[,"Description"],file=t)
close(t)
# system('sed s/^c/Array/ helpIndex.txt > js/helpIndex.js')
st = readLines("helpIndex.txt")
st = gsub("^c\\(", "Array\\(", st)
writeLines(text=st, "js/helpIndex.js")
}
id=makeIndexData()
writeIndexData(id)
Am I supposed to modify something before I source it?
My suspicious mind tells me maybe lib.loc in the line:
file <- system.file("CONTENTS", package = pkg, lib.loc = lib.loc)
should be be changed to:
lib.loc = '/usr/local/lib64/R/library'
Can anyone please clue me in? Any tip would be appreciated.
Thank you.
Regards,
Tena Sakai
tsakai@gallo.ucsf.edu
[[alternative HTML version deleted]]