[Rd] Non-administrator can't install packages (PR#9848)
Full_Name: Russ Lenth Version: 1.5.1 OS: Windows XP Pro Submission from: (NULL) (128.255.132.36) I run a Windows system on which I do not have administrator rights. I am unable to install R packages, even in a location that I have access to. I get a message that it can't write to the specified directory. I know I WAS able to do this last April (version 1.4.1??) on the same system -- I have several installed packages to show for it. Some R session excerpts are below. I have tried the same things on my laptop, with no problems; thus, I think this bug is related to my not having Administrator rights. By the way, in each call to install.packages(), I get an offer to create a new library directory, even though I have specified one explicitly in the "lib" argument. That seems like a bug too. My current workaround is to just download and unzip the file to that directory, with R not running. That seems to work, but I'm not sure everything gets set up properly that way. = Attempt to install a package to my usual location on a network drive: R> .libPaths() [1] "h:/pkg/R/library" "C:/PROGRA~1/R/R-25~1.1/library" R> install.packages( "odfWeave", lib="h:/pkg/R/library") Warning in install.packages("d:/downloads/odfWeave_0.5.9.zip", lib = "h:/pkg/R/library") : 'lib = "h:/pkg/R/library"' is not writable Error in install.packages("d:/downloads/odfWeave_0.5.9.zip", lib = "h:/pkg/R/library") : unable to install packages = Attempt to install to a local drive: R> install.packages( "odfWeave", lib="d:") Warning in install.packages("d:/downloads/odfWeave_0.5.9.zip", lib = "d:") : 'lib = "d:"' is not writable Error in install.packages("d:/downloads/odfWeave_0.5.9.zip", lib = "d:") : unable to install packages = Yet, I can write to that location: R> sink("h:/pkg/R/library/junk.txt") R> ls() R> sink() R> system("cat h:/pkg/R/library/junk.txt") [1] "align" "align.default" "align.lm" [4] "align.old" "align.very.old" "augment" . R> system("rm h:/pkg/R/library/junk.txt") R> __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] PR#9848
Oops -- I meant R version 2.5.1, not 1.5.1. My apologies. -- Russell V. Lenth, Professor Department of Statistics & Actuarial Science(319)335-0814FAX (319)335-3017 The University of Iowa [EMAIL PROTECTED] Iowa City, IA 52242 USA http://www.stat.uiowa.edu/~rlenth/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Bug in poly() (PR#11243)
Full_Name: Russell Lenth Version: 2.6.2 OS: Windows XP Pro Submission from: (NULL) (128.255.132.36) The poly() function allows a higher-degree polynomial than it should, when raw=FALSE. For example, consider 5 distinct 'x' values, each repeated twice. we can fit a polynomial of degree 8: = R> x = rep(1:5, 2) R> y = rnorm(10) R> lm(y ~ poly(x, 8)) Call: lm(formula = y ~ poly(x, 8)) Coefficients: (Intercept) poly(x, 8)1 poly(x, 8)2 poly(x, 8)3 poly(x, 8)4 poly(x, 8)5 -0.07790 0.58768 0.30147 -0.18237 0.64779 -0.0 poly(x, 8)6 poly(x, 8)7 poly(x, 8)8 -0.22694 -0.07500 0.17235 = If we specify 'raw=TRUE' in the same example, we are limited (as we should) to a degree-4 polynomial: = R> lm(y ~ poly(x, 8, raw=TRUE)) Call: lm(formula = y ~ poly(x, 8, raw = TRUE)) Coefficients: (Intercept) poly(x, 8, raw = TRUE)1 poly(x, 8, raw = TRUE)2 7.3958 -14.0150 8.2784 poly(x, 8, raw = TRUE)3 poly(x, 8, raw = TRUE)4 poly(x, 8, raw = TRUE)5 -1.9502 0.1597 NA poly(x, 8, raw = TRUE)6 poly(x, 8, raw = TRUE)7 poly(x, 8, raw = TRUE)8 NA NA NA = We do get an error with an even higher degree: = R> lm(y ~ poly(x, 10)) Error in poly(x, 10) : 'degree' must be less than number of points = Looking at the code for poly(), I think the problem is that it should check the 'rank' result from its call to qr(). [The above results are using Windows XP Pro, but I verified this bug under Linux as well (x86_64, dual core). It seems pretty obvious to me that this bug is not platform-dependent.] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] poly() can exceed degree k - 1 for k distinct points (PR#11251)
The poly() function can create more variables than can be fitted when there are replicated values. In the example below, 'x' has only 5 distinct values, but I can apparently fit a 12th-degree polynomial with no error messages or even nonzero coefficients: R> x = rep(1:5,3) R> y = rnorm(15) R> lm(y ~ poly(x, 12)) Call: lm(formula = y ~ poly(x, 12)) Coefficients: (Intercept) poly(x, 12)1 poly(x, 12)2 poly(x, 12)3 -0.274420.35822 -0.264122.11780 poly(x, 12)4 poly(x, 12)5 poly(x, 12)6 poly(x, 12)7 1.83117 -0.09260 -0.485721.94030 poly(x, 12)8 poly(x, 12)9 poly(x, 12)10 poly(x, 12)11 -0.88297 -1.045560.74289 -0.01422 poly(x, 12)12 -0.46548 If I try the same with raw=TRUE, only a 4th-degree polynomial is obtained: R> lm(y ~ poly(x, 12, raw=TRUE)) Call: lm(formula = y ~ poly(x, 12, raw = TRUE)) Coefficients: (Intercept) poly(x, 12, raw = TRUE)1 9.7527 -22.0971 poly(x, 12, raw = TRUE)2 poly(x, 12, raw = TRUE)3 15.3293-4.1005 poly(x, 12, raw = TRUE)4 poly(x, 12, raw = TRUE)5 0.3686 NA poly(x, 12, raw = TRUE)6 poly(x, 12, raw = TRUE)7 NA NA poly(x, 12, raw = TRUE)8 poly(x, 12, raw = TRUE)9 NA NA poly(x, 12, raw = TRUE)10 poly(x, 12, raw = TRUE)11 NA NA poly(x, 12, raw = TRUE)12 NA I believe that what is needed is a check on the 'rank' result after poly() calls the qr() function. System info: R version: 2.6.2 Windows XP Pro; also get same results on Linux x_64 dual-core system. [I thought I submitted this via the website yesterday, but I can find no trace of it. I apologize if this is a duplicate, but I don't think it is.] -- Russell V. Lenth, Professor Department of Statistics & Actuarial Science(319)335-0814FAX (319)335-3017 The University of Iowa [EMAIL PROTECTED] Iowa City, IA 52242 USA http://www.stat.uiowa.edu/~rlenth/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Bug in poly() (PR#11243)
I don't understand why this is a bug in usage. Is it because the 2nd argument is not named? I get the same behavior if I do name it: = [R version 2.6.2 (2008-02-08), Windows XP Pro] R> x = rep(1:4,3) R> y = (1:12)^1.5 R> lm(y ~ poly(x, degree=10)) Call: lm(formula = y ~ poly(x, degree = 10)) Coefficients: (Intercept) poly(x, degree = 10)1 poly(x, degree = 10)2 18.3937014.21385 0.58588 poly(x, degree = 10)3 poly(x, degree = 10)4 poly(x, degree = 10)5 -0.01770 3.34767 -11.46388 poly(x, degree = 10)6 poly(x, degree = 10)7 poly(x, degree = 10)8 0.51178 0.4429612.47199 poly(x, degree = 10)9 poly(x, degree = 10)10 -28.3897218.47439 = Is there a case where we *would* want a 10th degree polynomial fitted to only 4 distinct x values? A simple modification [changing 'length(x)' to 'length(unique(x))' in 2 places] seems to fix this: = R> mypoly ... if (raw) { if (degree >= length(unique(x))) stop("'degree' must be less than number of points") ... if (is.null(coefs)) { if (degree >= length(unique(x))) stop("'degree' must be less than number of points") ... R> lm(y ~ mypoly(x, degree=10)) Error in mypoly(x, degree = 10) : 'degree' must be less than number of points = Russ -- Russell V. Lenth, Professor Department of Statistics & Actuarial Science(319)335-0814FAX (319)335-3017 The University of Iowa [EMAIL PROTECTED] Iowa City, IA 52242 USA http://www.stat.uiowa.edu/~rlenth/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] No exit codes from RTerm (Windows) (PR#9296)
Full_Name: Russell V. Lenth Version: 2.3.1 OS: Windows XP Pro Submission from: (NULL) (128.255.132.188) I wrote a simple .BAT file to run the Sweave function on a file (via RTerm), then run pdflatex on the result (after RTerm exits). The issue is that if an error condition occurs in RTerm, it is prudent to not do the pdflatex processing afterward. Here are the relevant statements in the BAT script: echo Sweave("%1",style=F,eps=F) | Rterm --no-save --no-restore if not errorlevel == 0 goto end The problem is that the errorlevel seems to always be 0, even if an error occurs. I have a similar shell script for our linux system, and it works correctly. Are there no provisions for RTerm to return an exit code in Windows? It would be very useful to me if it would return a nonzero exit code when there is an error. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] No exit codes from RTerm (Windows) (PR#9296)
I am so embarrassed. I now see the syntax error in my original batch file; and if I correct it, it works just fine. I don't know why I didn't get a DOS error with it; if I had, it obviously would have saved me from reporting it as an R bug. My apologies for causing trouble -- it definitely is not a bug in R. best, Russ -- Russell V. Lenth, Professor Department of Statistics & Actuarial Science(319)335-0814FAX (319)335-3017 The University of Iowa [EMAIL PROTECTED] Iowa City, IA 52242 USA http://www.stat.uiowa.edu/~rlenth/ Prof Brian Ripley wrote: > Rterm (sic) does return an error status. You have not provided a > reproducible example, so here is one (done in tcsh) > > % echo 'q()' | rterm --vanilla --slave || echo failed > % echo 'q(status=3)' | rterm --vanilla --slave || echo failed > failed > % echo 'stop("test")' | rterm --vanilla --slave || echo failed > Error: test > Execution halted > failed > > Whatever the problem is in your case, it is not what you have > erroneously reported as a bug. (BTW, I knew this worked as the R > scripts, including the build process, make heavy use of it.) > > On Fri, 13 Oct 2006, [EMAIL PROTECTED] wrote: > >> Full_Name: Russell V. Lenth >> Version: 2.3.1 > > > Not current: see the FAQ which asks you not to report on obselete > versions of R. > >> OS: Windows XP Pro >> Submission from: (NULL) (128.255.132.188) >> >> >> I wrote a simple .BAT file to run the Sweave function on a file (via >> RTerm), >> then run pdflatex on the result (after RTerm exits). The issue is >> that if an >> error condition occurs in RTerm, it is prudent to not do the pdflatex >> processing >> afterward. >> >> Here are the relevant statements in the BAT script: >> >>echo Sweave("%1",style=F,eps=F) | Rterm --no-save --no-restore >>if not errorlevel == 0 goto end >> >> The problem is that the errorlevel seems to always be 0, even if an error >> occurs. I have a similar shell script for our linux system, and it works >> correctly. Are there no provisions for RTerm to return an exit code >> in Windows? >> It would be very useful to me if it would return a nonzero exit code >> when there >> is an error. >> >> __ >> 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