Re: [Rd] bug in R CMD INSTALL do_install under OS X
You're right William, unsetting the CDPATH variable does the trick. The R INSTALL script should unset it to avoid the problem. Thanks a lot, David On Mon, Dec 15, 2008 at 9:29 PM, William Dunlap wrote: > This problem could be caused by having CDPATH set. E.g., > > % env CDPATH=. ~/R-svn/r-devel/R/bin/R CMD INSTALL -l Rlib > testCMacros > /homes/bill/packages/Rlib > /homes/bill/R-svn/r-devel/R/bin/INSTALL: line 948: cd: > /homes/bill/packages/testCMacros > /a/seafiler01.na.tibco.com/vol/vol2/users/bill/packages/testCMacros: > No such file or directory >/bin/sed: can't read DESCRIPTION: No such file or directory >ERROR: no 'Package' field in 'DESCRIPTION' >/bin/sed: read error on /homes/bill/packages/testCMacros: Is a > directory > (It works fine if I set 'CDPATH='.) > > The happens because, from 'man cd' in > http://www.linuxhowtos.org/manpages/1p/cd.htm: > > If a non-empty directory name from CDPATH is used, or if > cd - is used, an absolute pathname of the new working > directory shall be written to the standard output as follows: >"%s\n", > Otherwise, there shall be no output. > > and INSTALL uses the idiom >`cd ${dir} && /bin/pwd` > to convert the directory name dir to a full path. > > libtools explicitly unsets CDPATH, presumably to avoid this > sort of problem. All the R scripts should do so. > > Bill Dunlap > TIBCO Software Inc - Spotfire Division > wdunlap tibco.com > > > -Original Message- > > From: r-devel-boun...@r-project.org > > [mailto:r-devel-boun...@r-project.org] On Behalf Of David Rossell > > Sent: Monday, December 15, 2008 2:05 AM > > To: r-devel@r-project.org > > Subject: [Rd] bug in R CMD INSTALL do_install under OS X > > > > Hi, I believe I've encountered a bug in the do_install function in the > > script used by R CMD INSTALL. I'm using R 2.8.0 under OS X > > 10.5.5. I was > > trying to install a package from source (the package gaga > > which I maintain, > > which I checked and builds correctly for R 2.8.0) when I get the error > > message > > > > * Installing to library '/Users/drossell/Desktop/R-2.8.0/library' > > /Users/drossell/Desktop/R-2.8.0/bin/INSTALL: line 950: cd: > > /Volumes/biostats/projects/routines/R/gaga > > /Volumes/biostats/projects/routines/R/gaga: No such file or directory > > sed: DESCRIPTION: No such file or directory > > ERROR: no 'Package' field in 'DESCRIPTION' > > > > I get this same error for any other package that I try to install. > > > > Upon debugging the script, I've found that the script is > > trying to cd to > > "/Volumes/biostats/projects/routines/R/gaga\n/Volumes/biostats > /projects/routines/R/gaga". > > That is, the directory is repeated twice, which causes the > > installation to > > fail. To temporarily fix the bug I commented out the 1st two > > lines in the > > do_install function and manually specified the directory. > > After doing this > > the package installs just fine. > > > > # cd "${1}" > > # pkg_dir="${1}" > > cd "/Volumes/biostats/projects/routines/R/gaga" #line added > > pkg_dir="/Volumes/biostats/projects/routines/R/gaga" #line added > > > > Thanks, > > > > David > > > > [[alternative HTML version deleted]] > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > -- David Rossell Manager, Bioinformatics and Biostatistics unit IRB Barcelona Tel (+34) 93 402 0217 Fax (+34) 93 402 0257 [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] "could not find function" error in "R CMD check"
Hi, All: What might cause "R CMD check" to report, "could not find function" for a function that has long been in the 'fda' package? Both Jim Ramsay in Ottawa, Canada, and I in San Jose, CA, get this same error. I replicated it with a fresh, anonymous checkout from R-Forge (svn checkout svn://svn.r-forge.r-project.org/svnroot/fda). With this, I did "R CMD build pkg", then "R CMD check fda_2.1.0.tar.gz", with the following result: D:\spencerg\statmtds\splines\fda\tmp\fda>R CMD check fda_2.1.0.tar.gz * checking for working pdflatex ... OK * using log directory 'D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck' * using R version 2.8.0 (2008-10-20) * using session charset: ISO8859-1 * checking for file 'fda/DESCRIPTION' ... OK * this is package 'fda' version '2.1.0' * checking package name space information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking for .dll and .exe files ... OK * checking whether package 'fda' can be installed ... ERROR Installation failed. See 'D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck/00install.out' for deta ils. "00install.out" is as follows: installing R.css in D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck -- Making package fda adding build stamp to DESCRIPTION installing NAMESPACE file and metadata installing R files installing demos installing inst files installing data files preparing package fda for lazy loading Loading required package: splines Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric Error in basisfd(type = type, rangeval = rangeval, nbasis = nbasis, params = params, : could not find function "use.proper.basis" Error: unable to load R code in package 'fda' Execution halted make[2]: *** [lazyload] Error 1 make[1]: *** [all] Error 2 make: *** [pkg-fda] Error 2 *** Installation of fda failed *** Removing 'D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck/fda' Both "basisfd" and "use.proper.basis" have been in the "fda" package for years and have passed "R CMD check" many times. I'm running Windows XP Pro and Jim is running Vista. Any suggestions? Thanks, Spencer Graves sessionInfo() R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] "could not find function" error in "R CMD check"
On 16/12/2008 10:55 AM, Spencer Graves wrote: Hi, All: What might cause "R CMD check" to report, "could not find function" for a function that has long been in the 'fda' package? I would guess that you are calling it from within your *.R files. It's called from a lot of places, so I couldn't spot the one that's causing the trouble, but something like this could do it: f <- function() { } # Function is done, by mistake basisfd() # This is a top level call, not within f }# Not sure why the parser wouldn't see this # so this guess may be wrong In general, you can call functions from within the *.R files, but you have to be careful to make sure they are already defined (and you shouldn't count on any side effects from them. Duncan Murdoch Both Jim Ramsay in Ottawa, Canada, and I in San Jose, CA, get this same error. I replicated it with a fresh, anonymous checkout from R-Forge (svn checkout svn://svn.r-forge.r-project.org/svnroot/fda). With this, I did "R CMD build pkg", then "R CMD check fda_2.1.0.tar.gz", with the following result: D:\spencerg\statmtds\splines\fda\tmp\fda>R CMD check fda_2.1.0.tar.gz * checking for working pdflatex ... OK * using log directory 'D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck' * using R version 2.8.0 (2008-10-20) * using session charset: ISO8859-1 * checking for file 'fda/DESCRIPTION' ... OK * this is package 'fda' version '2.1.0' * checking package name space information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking for .dll and .exe files ... OK * checking whether package 'fda' can be installed ... ERROR Installation failed. See 'D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck/00install.out' for deta ils. "00install.out" is as follows: installing R.css in D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck -- Making package fda adding build stamp to DESCRIPTION installing NAMESPACE file and metadata installing R files installing demos installing inst files installing data files preparing package fda for lazy loading Loading required package: splines Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric Error in basisfd(type = type, rangeval = rangeval, nbasis = nbasis, params = params, : could not find function "use.proper.basis" Error: unable to load R code in package 'fda' Execution halted make[2]: *** [lazyload] Error 1 make[1]: *** [all] Error 2 make: *** [pkg-fda] Error 2 *** Installation of fda failed *** Removing 'D:/spencerg/statmtds/splines/fda/tmp/fda/fda.Rcheck/fda' Both "basisfd" and "use.proper.basis" have been in the "fda" package for years and have passed "R CMD check" many times. I'm running Windows XP Pro and Jim is running Vista. Any suggestions? Thanks, Spencer Graves sessionInfo() R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] "could not find function" error in "R CMD check"
Using Martin's sourceDir() function (from example(source)), I found your problem: You have some test code in your R dir. smooth.bibasis.test.R :Error in basisfd(type = type, rangeval = rangeval, nbasis = nbasis, params = params, : could not find function "use.proper.basis" That file smooth.bibasis.test.R probably belongs in the tests directory, where it will be run after all the files have been sourced. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] "could not find function" error in "R CMD check"
Hi, Duncan: Thanks very much. That fixed that problem. I should have tried that myself; I've heard essentially that suggestion before, but couldn't think of it in this case. Best Wishes, Spencer Graves Duncan Murdoch wrote: Using Martin's sourceDir() function (from example(source)), I found your problem: You have some test code in your R dir. smooth.bibasis.test.R :Error in basisfd(type = type, rangeval = rangeval, nbasis = nbasis, params = params, : could not find function "use.proper.basis" That file smooth.bibasis.test.R probably belongs in the tests directory, where it will be run after all the files have been sourced. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel