Re: [Rd] vector labels are not permuted properly in a call to sort() (R 2.1)
> "AndyL" == Liaw, Andy <[EMAIL PROTECTED]> > on Tue, 4 Oct 2005 13:51:11 -0400 writes: AndyL> The `problem' is that sort() does not doing anything special when given AndyL> a matrix: it only treat it as a vector. After sorting, it copies AndyL> attributes of the original input to the output. Since dimnames are AndyL> attributes, they get copied as is. exactly. Thanks Andy. And I think users would want this (copying of attributes) in many cases; in particular for user-created attributes ?sort really talks about sorting of vectors and factors; and it doesn't mention attributes explicitly at all {which should probably be improved}. One could wonder if R should keep the dim & dimnames attributes for arrays and matrices. S-plus (6.2) simply drops them {returning a bare unnames vector} and that seems pretty reasonable to me. At least the user would never make the wrong assumptions that Greg made about ``matrix sorting''. AndyL> Try: >> y <- matrix(8:1, 4, 2, dimnames=list(LETTERS[1:4], NULL)) >> y AndyL> [,1] [,2] AndyL> A84 AndyL> B73 AndyL> C62 AndyL> D51 >> sort(y) AndyL> [,1] [,2] AndyL> A15 AndyL> B26 AndyL> C37 AndyL> D48 AndyL> Notice the row names stay the same. I'd argue that this is the correct AndyL> behavior. AndyL> Andy >> From: Greg Finak >> >> Not sure if this is the correct forum for this, yes, R-devel is the proper forum. {also since this is really a proposal for a change in R ...} >> but I've found what I >> would consider to be a potentially serious bug to the >> unsuspecting user. >> Given a numeric vector V with class labels in R, the following calls >> >> 1. >> > sort(as.matrix(V)) >> >> and >> >> 2. >> >as.matrix(sort(V)) >> >> produce different ouput. The vector is sorted properly in >> both cases, >> but only 2. produces the correct labeling of the vector. The call to >> 1. produces a vector with incorrect labels (not sorted). >> >> Code: >> >X<-c("A","B","C","D","E","F","G","H") >> >Y<-rev(1:8) >> >names(Y)<-X >> > Y >> A B C D E F G H >> 8 7 6 5 4 3 2 1 >> > sort(as.matrix(Y)) >> [,1] >> A1 >> B2 >> C3 >> D4 >> E5 >> F6 >> G7 >> H8 >> > as.matrix(sort(Y)) >> [,1] >> H1 >> G2 >> F3 >> E4 >> D5 >> C6 >> B7 >> A8 >> __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] R crashes for large formulas in lm() (PR#8180)
Full_Name: Hallgeir Grinde Version: 2.1.1 OS: Windows XP Submission from: (NULL) (144.127.1.1) While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables are at least 8. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] R crashes for large formulas in lm() (PR#8180)
Have you considered that 8 variables will give you sum(choose(8,1:8)) [1] 255 terms. That's a suspicious number. Have you checked whether there is a limit in the code? - Full_Name: Hallgeir Grinde Version: 2.1.1 OS: Windows XP Submission from: (NULL) (144.127.1.1) While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables are at least 8. -- Ken Knoblauch Inserm U371 Cerveau et Vision Dept. of Cognitive Neuroscience 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.lyon.inserm.fr/371/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] R crashes for large formulas in lm() (PR#8180)
Oops, sorry. I didn't notice the ^2... Nevermind. Have you considered that 8 variables will give you sum(choose(8,1:8)) [1] 255 terms. That's a suspicious number. Have you checked whether there is a limit in the code? - Full_Name: Hallgeir Grinde Version: 2.1.1 OS: Windows XP Submission from: (NULL) (144.127.1.1) While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables are at least 8. -- Ken Knoblauch Inserm U371 Cerveau et Vision Dept. of Cognitive Neuroscience 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.lyon.inserm.fr/371/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > Full_Name: Hallgeir Grinde > Version: 2.1.1 > OS: Windows XP > Submission from: (NULL) (144.127.1.1) > > > While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables > are at least 8. OK, let's try to reproduce that: > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) No crash, a quite reasonable fit. Can we please have a reproducible example, as we do ask? -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
"Ken Knoblauch" <[EMAIL PROTECTED]> writes: > Oops, sorry. I didn't notice the ^2... > Nevermind. You could still have a point, but with 255^2 terms (all but 255 of which will be redundant since x^2 == x:x == x in modeling language). Presumably someone thought that noone in their right mind would specify 65000 terms... > > Have you considered that 8 variables will give you > sum(choose(8,1:8)) > [1] 255 > terms. > That's a suspicious number. Have you checked whether there is a limit in > the code? > > - > Full_Name: Hallgeir Grinde > Version: 2.1.1 > OS: Windows XP > Submission from: (NULL) (144.127.1.1) > > > While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of > variables > are at least 8. > -- > Ken Knoblauch > Inserm U371 > Cerveau et Vision > Dept. of Cognitive Neuroscience > 18 avenue du Doyen Lépine > 69500 Bron > France > tel: +33 (0)4 72 91 34 77 > fax: +33 (0)4 72 91 34 61 > portable: +33 (0)6 84 10 64 10 > http://www.lyon.inserm.fr/371/ > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Fwd: R and Java
> I am a grad student and am working on a project where i need to integrate > java and R. I have a front end in java and i need to call R functions and > be able to dispaly the plots and graphs produced by R on my java front end. > I came across some tools like SJava and rserve...but am not sure which best > suits my application. Your suggestion will be really helpful. The only valuable choice to integrate java and R is rserve. With RSjava, data don't persist between 2 two commands, so you can't set a variable in R from java in one instruction and re-use this data in the next instruction. Rserve is an client/server library, client is pure java (you can easily deploy it on *nix and Windows) and each connection has its own object space in R (only under *nix). Laurent. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
Prof Brian Ripley wrote: > OK, let's try to reproduce that: > > >>x1 <- runif(1000) ... >>y <- rnorm(1000) >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > No crash, a quite reasonable fit. Add one more: > x9 <- runif(1000) works with 8: > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) but go 'one over the eight' and: > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8*x9)^2) Segmentation fault platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major2 minor1.1 year 2005 month06 day 20 language R Baz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
Prof Brian Ripley wrote: > OK, let's try to reproduce that: > > >>x1 <- runif(1000) ... >>y <- rnorm(1000) >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > No crash, a quite reasonable fit. Add one more: > x9 <- runif(1000) works with 8: > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) but go 'one over the eight' and: > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8*x9)^2) Segmentation fault platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major2 minor1.1 year 2005 month06 day 20 language R Baz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
Prof Brian Ripley wrote: > On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > > >>Full_Name: Hallgeir Grinde >>Version: 2.1.1 >>OS: Windows XP >>Submission from: (NULL) (144.127.1.1) >> >> >>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables >>are at least 8. > > > OK, let's try to reproduce that: > > >>x1 <- runif(1000) >>x2 <- runif(1000) >>x3 <- runif(1000) >>x4 <- runif(1000) >>x5 <- runif(1000) >>x6 <- runif(1000) >>x7 <- runif(1000) >>x8 <- runif(1000) >>y <- rnorm(1000) >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > No crash, a quite reasonable fit. > > Can we please have a reproducible example, as we do ask? > Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 r35682M) on WinNT 4.0, SP6. Let's make it reproducible: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) Uwe Ligges __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
> set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) For me (with 9 variables) this crashes in model.matrix: > f1=y~(x1*x2*x3*x4*x5*x6*x7*x8*x9)^2 > model.matrix(f1) Segmentation fault I guess someone with a debug-compiled R can get a bit further... Baz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
On Wed, 2005-10-05 at 14:12 +0200, [EMAIL PROTECTED] wrote: > Prof Brian Ripley wrote: > > > On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > > > > > >>Full_Name: Hallgeir Grinde > >>Version: 2.1.1 > >>OS: Windows XP > >>Submission from: (NULL) (144.127.1.1) > >> > >> > >>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of > >>variables > >>are at least 8. > > > > > > OK, let's try to reproduce that: > > > > > >>x1 <- runif(1000) > >>x2 <- runif(1000) > >>x3 <- runif(1000) > >>x4 <- runif(1000) > >>x5 <- runif(1000) > >>x6 <- runif(1000) > >>x7 <- runif(1000) > >>x8 <- runif(1000) > >>y <- rnorm(1000) > >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > > > > No crash, a quite reasonable fit. > > > > Can we please have a reproducible example, as we do ask? > > > > Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 > r35682M) on WinNT 4.0, SP6. > > > Let's make it reproducible: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) No problems on FC4 using Version 2.1.1 Patched (2005-10-04): > summary(fit) Call: lm(formula = y ~ (x1 * x2 * x3 * x4 * x5 * x6 * x7 * x8)^2) Residuals: Min1QMedian3Q Max -3.315028 -0.532338 0.005368 0.548012 2.957057 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept)16.246015.7375 1.032 0.3023 x1-10.031029.7557 -0.337 0.7361 x2-26.267824.0473 -1.092 0.2750 x3-42.571332.9481 -1.292 0.1967 ... x1:x2:x4:x5:x6:x7:x8 -339.8099 1024.8652 -0.332 0.7403 x1:x3:x4:x5:x6:x7:x8 -833.5375 1095.1153 -0.761 0.4468 x2:x3:x4:x5:x6:x7:x8 -546.0684 1050.8648 -0.520 0.6035 x1:x2:x3:x4:x5:x6:x7:x8 533.8390 1861.5862 0.287 0.7744 --- Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1 Residual standard error: 1.001 on 744 degrees of freedom Multiple R-Squared: 0.2541, Adjusted R-squared: -0.001499 F-statistic: 0.9941 on 255 and 744 DF, p-value: 0.5161 Is this perhaps a RAM issue? I have 2 Gb. Marc __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
R closes down while running the code described below. How i can get it to crash on your PC, i do not know... -Hallgeir Grinde > > While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables > are at least 8. OK, let's try to reproduce that: > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) No crash, a quite reasonable fit. Can we please have a reproducible example, as we do ask? -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 NOTICE Please immediately e-mail back to sender if you are not the intended recipient. Thereafter delete the e-mail along with any attachments without making copies. Elkem reserves all rights of privilege, confidentiality and copyright. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Fwd: R and Java
On Wed, 2005-10-05 at 14:08 +0200, Laurent Jourdren wrote: > > I am a grad student and am working on a project where i need to integrate > > java and R. I have a front end in java and i need to call R functions and > > be able to dispaly the plots and graphs produced by R on my java front end. > > I came across some tools like SJava and rserve...but am not sure which best > > suits my application. Your suggestion will be really helpful. > > > The only valuable choice to integrate java and R is rserve. > > With RSjava, data don't persist between 2 two commands, so you can't > set a > variable in R from java in one instruction and re-use this data in the next > instruction. > > Rserve is an client/server library, client is pure java (you can easily > deploy it on *nix and Windows) and each connection has its own object space > in R (only under *nix). > > Laurent. You might also want to look at JGR (a Java GUI for R) to see how they have done things: http://stats.math.uni-augsburg.de/JGR/ HTH, Marc Schwartz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
This is almost certainly C stack overflow, which will be _very_ OS-specific. I can run this 9-var example in Linux with a stacksize of 30Mb, but not the default 10Mb. I tried it with the default stack under valgrind, and it works. Windows versions of R have I believe a stack of 8Mb, and so I suspect are running close to that with 8-var example. The problem appears to be recursion in StripTerm. On Wed, 5 Oct 2005, Barry Rowlingson wrote: > Prof Brian Ripley wrote: > >> OK, let's try to reproduce that: >> >> >>> x1 <- runif(1000) > ... >>> y <- rnorm(1000) >>> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) >> >> >> No crash, a quite reasonable fit. > > Add one more: > > > x9 <- runif(1000) > > works with 8: > > > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > but go 'one over the eight' and: > > > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8*x9)^2) > Segmentation fault > > > platform i686-pc-linux-gnu > arch i686 > os linux-gnu > system i686, linux-gnu > status > major2 > minor1.1 > year 2005 > month06 > day 20 > language R > > Baz > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004613C000257091_= Content-Type: text/plain; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) -> R crashes fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 +x4:x5+x4:x6+x4:x7+x4:x8 +x5:x6+x5:x7+x5:x8 +x6:x7+x6:x8 +x7:x8) -> R does not crash This is the same formula, at least it should be. Uwe Ligges <[EMAIL PROTECTED]> 05.10.2005 12:13 Til:Prof Brian Ripley <[EMAIL PROTECTED]> cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180) Prof Brian Ripley wrote: > On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > > >>Full_Name: Hallgeir Grinde >>Version: 2.1.1 >>OS: Windows XP >>Submission from: (NULL) (144.127.1.1) >> >> >>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables >>are at least 8. > > > OK, let's try to reproduce that: > > >>x1 <- runif(1000) >>x2 <- runif(1000) >>x3 <- runif(1000) >>x4 <- runif(1000) >>x5 <- runif(1000) >>x6 <- runif(1000) >>x7 <- runif(1000) >>x8 <- runif(1000) >>y <- rnorm(1000) >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > No crash, a quite reasonable fit. > > Can we please have a reproducible example, as we do ask? > Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 r35682M) on WinNT 4.0, SP6. Let's make it reproducible: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) Uwe Ligges NOTICE Please immediately e-mail back to sender if you are not the intended recipient. Thereafter delete the e-mail along with any attachments without making copies. Elkem reserves all rights of privilege, confidentiality and copyright. --=_alternative 004613C000257091_= Content-Type: text/html; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) -> R crashes fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 +x4:x5+x4:x6+x4:x7+x4:x8 +x5:x6+x5:x7+x5:x8 +x6:x7+x6:x8 +x7:x8) -> R does not crash This is the same formula, at least it should be. Uwe Ligges <[EMAIL PROTECTED]> 05.10.2005 12:13 Til: Prof Brian Ripley <[EMAIL PROTECTED]> cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180) Prof Brian Ripley wrote: > On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > > >>Full_Name: Hallgeir Grinde >>Version: 2.1.1 >>OS: Windows XP >>Submission from: (NULL) (144.127.1.1) >> >> >>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables >>are at least 8. > > > OK, let's try to reproduce that: > > >>x1 <- runif(1000) >>x2 <- runif(1000) >>x3 <- runif(1000) >>x4 <- runif(1000) >>x5 <- runif(1000) >>x6 <- runif(1000) >>x7 <- runif(1000) >>x8 <- runif(1000) >>y <- rnorm(1000) >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > No crash, a quite reasonable fit. > > Can we please have a reproducible example, as we do ask? > Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 r35682M) on WinNT 4.0, SP6. Let's make it reproducible: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) Uwe Ligges NOTICE Please immediately e-mail back to sender if you are not the intended recipient. Thereafter delete the e-mail along with any attachments without making copies. Elkem reserves all rights of privilege, confidentiality and copyright. --=_alternative 004613C000257091_=-- __ R-dev
[Rd] Problems with autoconf example from r-ext.
Dear R-developers, I am trying to reproduce the autoconf.ac example from R-ext and fail. My autoconf file looks like this [autoconf.ac] # original by Friedrich Leisch, much changed by BDR AC_INIT([SBMLodeSolveR]) dnl Select an optional include path, from a configure option dnl or from an environment variable. AC_ARG_WITH([sbmlode-include], AC_HELP_STRING([--with-sbmlode-include=INCLUDE_PATH], [the location of SBMLODE header files]), [sbmlode_include_path=$withval]) if test [ -n "$sbmlode_include_path" ] ; then AC_SUBST([CPPFLAGS],["-I${sbmlode_include_path} ${CPPFLAGS}"]) else if test [ -n "${SBMLODE_INCLUDE}" ] ; then AC_SUBST([CPPFLAGS],["-I${SBMLODE_INCLUDE} ${CPPFLAGS}"]) fi fi dnl ditto for a library path AC_ARG_WITH([sbmlode-lib],AC_HELP_STRING([--with-sbmlode-lib=LIB_PATH],[the location of libsbmlode libraries]),[sbmlode_lib_path=$withval]) if test [ -n "$sbmlode_lib_path" ] ; then AC_SUBST([LIBS],[" -L${sbmlode_lib_path} ${LIBS}"]) else if test [ -n "${SBMLODE_LIBS}" ] ; then AC_SUBST([LIBS],["-I${SBMLODE_LIBS} ${LIBS}"]) fi fi dnl Now find the compiler and compiler flags to use : ${R_HOME=`R RHOME`} if test -z "${R_HOME}"; then echo "could not determine R_HOME" exit 1 fi CC=`"${R_HOME}/bin/R" CMD config CC` CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS` dnl substitute CPPFLAGS and LIBS AC_SUBST(CPPFLAGS) AC_SUBST(LIBS) dnl and do subsitution in the src/Makevars.in AC_OUTPUT(src/Makevars) [end autoconf.ac] I rund autoconf.. [Makevars.in] [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [end-Makevars.in] I rund R CMD with R CMD INSTALL --configure-args='--with-sbmlode-lib=/data/opt/sbmlodesolve/include \ --with-sbmlode-include=/data/opt/sbmlodesolve/lib' \ SBMLodeSolveR What I am getting is a [Makvars] PKG_CFLAGS= PKG_LIBS= -L/data/opt/sbmlodesolve/include [end-Makevars] and the following warnings [warnings] * Installing *source* package 'SBMLodeSolveR' ... configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: /data/opt/sbmlodesolve/lib configure: creating ./config.status config.status: creating src/Makevars * [end-warnings] Any suggestions? Eryk __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > -> R crashes > > fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 >+x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 >+x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 >+x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 >+x4:x5+x4:x6+x4:x7+x4:x8 >+x5:x6+x5:x7+x5:x8 >+x6:x7+x6:x8 >+x7:x8) > -> R does not crash > This is the same formula, at least it should be. It is not the same formula at all. Try > terms(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2, simplify=TRUE) y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x1:x2 + x1:x3 + x1:x4 + x1:x5 + x1:x6 + x1:x7 + x1:x8 + x2:x3 + x2:x4 + x2:x5 + x2:x6 + x2:x7 + x2:x8 + x3:x4 + x3:x5 + x3:x6 + x3:x7 + x3:x8 + x4:x5 + x4:x6 + x4:x7 + x4:x8 + x5:x6 + x5:x7 + x5:x8 + x6:x7 + x6:x8 + x7:x8 + x1:x2:x3 + x1:x2:x4 + x1:x3:x4 + x1:x2:x5 + x1:x3:x5 + ... x1:x3:x4:x5:x6:x7:x8 + x2:x3:x4:x5:x6:x7:x8 + x1:x2:x3:x4:x5:x6:x7:x8 Did you actually want lm(y~(x1+x2+x3+x4+x5+x6+x7+x8)^2) ? > > > > > > Uwe Ligges <[EMAIL PROTECTED]> > 05.10.2005 12:13 > >Til:Prof Brian Ripley <[EMAIL PROTECTED]> >cc: [EMAIL PROTECTED], [EMAIL PROTECTED] >Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180) > > > Prof Brian Ripley wrote: > >> On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: >> >> >>> Full_Name: Hallgeir Grinde >>> Version: 2.1.1 >>> OS: Windows XP >>> Submission from: (NULL) (144.127.1.1) >>> >>> >>> While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of > variables >>> are at least 8. >> >> >> OK, let's try to reproduce that: >> >> >>> x1 <- runif(1000) >>> x2 <- runif(1000) >>> x3 <- runif(1000) >>> x4 <- runif(1000) >>> x5 <- runif(1000) >>> x6 <- runif(1000) >>> x7 <- runif(1000) >>> x8 <- runif(1000) >>> y <- rnorm(1000) >>> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) >> >> >> No crash, a quite reasonable fit. >> >> Can we please have a reproducible example, as we do ask? >> > > Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 > r35682M) on WinNT 4.0, SP6. > > > Let's make it reproducible: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > Uwe Ligges > > > >NOTICE > Please immediately e-mail back to sender > if you are not the intended recipient. > > Thereafter delete the e-mail along with > any attachments without making copies. > > Elkem reserves all rights of privilege, > confidentiality and copyright. > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
[EMAIL PROTECTED] writes: > Dette er en melding med flere deler i MIME-format. > --=_alternative 004613C000257091_= > Content-Type: text/plain; charset="US-ASCII" > > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > -> R crashes > > fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 > +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 > +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 > +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 > +x4:x5+x4:x6+x4:x7+x4:x8 > +x5:x6+x5:x7+x5:x8 > +x6:x7+x6:x8 > +x7:x8) > -> R does not crash > This is the same formula, at least it should be. It isn't and it shouldn't. (Try it for smaller values of 8) y~(x1+x2+x3+x4+x5+x6+x7+x8)^2 should be same as the second formula, modulo the syntax error. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
> From: Peter Dalgaard > > [EMAIL PROTECTED] writes: > > > Dette er en melding med flere deler i MIME-format. > > --=_alternative 004613C000257091_= > > Content-Type: text/plain; charset="US-ASCII" > > > > And some more informastion I forgot. > > R does not crash if I write out the formula: > > > > set.seed(123) > > x1 <- runif(1000) > > x2 <- runif(1000) > > x3 <- runif(1000) > > x4 <- runif(1000) > > x5 <- runif(1000) > > x6 <- runif(1000) > > x7 <- runif(1000) > > x8 <- runif(1000) > > y <- rnorm(1000) > > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > -> R crashes > > > > fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 > > +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 > > +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 > > +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 > > +x4:x5+x4:x6+x4:x7+x4:x8 > > +x5:x6+x5:x7+x5:x8 > > +x6:x7+x6:x8 > > +x7:x8) > > -> R does not crash > > This is the same formula, at least it should be. > > It isn't and it shouldn't. (Try it for smaller values of 8) Er, which smaller values of 8 would you suggest? 8-) Andy > y~(x1+x2+x3+x4+x5+x6+x7+x8)^2 should be same as the second formula, > modulo the syntax error. > > > -- >O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B > c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K > (*) \(*) -- University of Copenhagen Denmark Ph: > (+45) 35327918 > ~~ - ([EMAIL PROTECTED]) FAX: > (+45) 35327907 > > __ > 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] vector labels are not permuted properly in a call to sort() (R 2.1)
Martin Maechler wrote: > > "AndyL" == Liaw, Andy <[EMAIL PROTECTED]> > > on Tue, 4 Oct 2005 13:51:11 -0400 writes: > > AndyL> The `problem' is that sort() does not doing anything special when > given > AndyL> a matrix: it only treat it as a vector. After sorting, it copies > AndyL> attributes of the original input to the output. Since dimnames are > AndyL> attributes, they get copied as is. > > exactly. Thanks Andy. > > And I think users would want this (copying of attributes) in > many cases; in particular for user-created attributes > > ?sort really talks about sorting of vectors and factors; >and it doesn't mention attributes explicitly at all >{which should probably be improved}. > > One could wonder if R should keep the dim & dimnames > attributes for arrays and matrices. > S-plus (6.2) simply drops them {returning a bare unnames vector} > and that seems pretty reasonable to me. This is as described in the Blue book, p.146, "Throwing Away Attributes". > > At least the user would never make the wrong assumptions that > Greg made about ``matrix sorting''. > > > AndyL> Try: > > >> y <- matrix(8:1, 4, 2, dimnames=list(LETTERS[1:4], NULL)) > >> y > AndyL> [,1] [,2] > AndyL> A84 > AndyL> B73 > AndyL> C62 > AndyL> D51 > >> sort(y) > AndyL> [,1] [,2] > AndyL> A15 > AndyL> B26 > AndyL> C37 > AndyL> D48 > > AndyL> Notice the row names stay the same. I'd argue that this is the > correct > AndyL> behavior. > > AndyL> Andy > > > >> From: Greg Finak > >> > >> Not sure if this is the correct forum for this, > > yes, R-devel is the proper forum. > {also since this is really a proposal for a change in R ...} > > >> but I've found what I > >> would consider to be a potentially serious bug to the > >> unsuspecting user. > >> Given a numeric vector V with class labels in R, the following calls > >> > >> 1. > >> > sort(as.matrix(V)) > >> > >> and > >> > >> 2. > >> >as.matrix(sort(V)) > >> > >> produce different ouput. The vector is sorted properly in > >> both cases, > >> but only 2. produces the correct labeling of the vector. The call to > >> 1. produces a vector with incorrect labels (not sorted). > >> > >> Code: > >> >X<-c("A","B","C","D","E","F","G","H") > >> >Y<-rev(1:8) > >> >names(Y)<-X > >> > Y > >> A B C D E F G H > >> 8 7 6 5 4 3 2 1 > >> > sort(as.matrix(Y)) > >> [,1] > >> A1 > >> B2 > >> C3 > >> D4 > >> E5 > >> F6 > >> G7 > >> H8 > >> > as.matrix(sort(Y)) > >> [,1] > >> H1 > >> G2 > >> F3 > >> E4 > >> D5 > >> C6 > >> B7 > >> A8 > >> > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel -- David __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Problems with autoconf example from r-ext.
The current R-exts.texi has AC_INIT([RODBC], 1.1.4) dnl package name, version and that is crucially different from your example. Autoconf 2.59 has a barely documented back-compatibility mode than is invoked for AC_INIT with just one argument. since in has a pare On Wed, 5 Oct 2005, nwew wrote: > Dear R-developers, > > I am trying to reproduce the autoconf.ac example from R-ext and fail. > > My autoconf file looks like this > > [autoconf.ac] > # original by Friedrich Leisch, much changed by BDR > > AC_INIT([SBMLodeSolveR]) > > dnl Select an optional include path, from a configure option > dnl or from an environment variable. > AC_ARG_WITH([sbmlode-include], >AC_HELP_STRING([--with-sbmlode-include=INCLUDE_PATH], > [the location of SBMLODE header files]), >[sbmlode_include_path=$withval]) > if test [ -n "$sbmlode_include_path" ] ; then > AC_SUBST([CPPFLAGS],["-I${sbmlode_include_path} ${CPPFLAGS}"]) > else > if test [ -n "${SBMLODE_INCLUDE}" ] ; then > AC_SUBST([CPPFLAGS],["-I${SBMLODE_INCLUDE} ${CPPFLAGS}"]) > fi > fi > > > dnl ditto for a library path > AC_ARG_WITH([sbmlode-lib],AC_HELP_STRING([--with-sbmlode-lib=LIB_PATH],[the > location of libsbmlode libraries]),[sbmlode_lib_path=$withval]) > > if test [ -n "$sbmlode_lib_path" ] ; then > AC_SUBST([LIBS],[" -L${sbmlode_lib_path} ${LIBS}"]) > else >if test [ -n "${SBMLODE_LIBS}" ] ; then > AC_SUBST([LIBS],["-I${SBMLODE_LIBS} ${LIBS}"]) >fi > fi > > dnl Now find the compiler and compiler flags to use > : ${R_HOME=`R RHOME`} > if test -z "${R_HOME}"; then >echo "could not determine R_HOME" >exit 1 > fi > CC=`"${R_HOME}/bin/R" CMD config CC` > CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS` > > > dnl substitute CPPFLAGS and LIBS > AC_SUBST(CPPFLAGS) > AC_SUBST(LIBS) > dnl and do subsitution in the src/Makevars.in > AC_OUTPUT(src/Makevars) > > [end autoconf.ac] > > I rund autoconf.. > > [Makevars.in] > [EMAIL PROTECTED]@ > [EMAIL PROTECTED]@ > [end-Makevars.in] > > I rund R CMD with > > R CMD INSTALL > --configure-args='--with-sbmlode-lib=/data/opt/sbmlodesolve/include \ > --with-sbmlode-include=/data/opt/sbmlodesolve/lib' \ > SBMLodeSolveR > > > What I am getting is a > > [Makvars] > PKG_CFLAGS= > PKG_LIBS= -L/data/opt/sbmlodesolve/include > [end-Makevars] > > > and the following warnings > > [warnings] > * Installing *source* package 'SBMLodeSolveR' ... > configure: WARNING: you should use --build, --host, --target > configure: WARNING: invalid host type: /data/opt/sbmlodesolve/lib > configure: creating ./config.status > config.status: creating src/Makevars > * > [end-warnings] > > Any suggestions? > > Eryk > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004C4E4A00257091_= Content-Type: text/plain; charset="US-ASCII" Yes. so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? and there is a difference in (x1*x2*x3*x4*x5*x6*x7*x8)^2 and (x1*x2*x3*x4*x5*x6*x7*x8) althoug the resulting formulas are the same, or? This fikses my problem, but R still crashes for the large formula. It may be due to stack owerflow, but i guess this can be altered maually? Prof Brian Ripley <[EMAIL PROTECTED]> 05.10.2005 12:50 Til:[EMAIL PROTECTED] cc: Uwe Ligges <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Emne: Re: Ad: Re: [Rd] R crashes for large formulas in lm() (PR#8180) On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > -> R crashes > > fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 >+x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 >+x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 >+x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 >+x4:x5+x4:x6+x4:x7+x4:x8 >+x5:x6+x5:x7+x5:x8 >+x6:x7+x6:x8 >+x7:x8) > -> R does not crash > This is the same formula, at least it should be. It is not the same formula at all. Try > terms(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2, simplify=TRUE) y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x1:x2 + x1:x3 + x1:x4 + x1:x5 + x1:x6 + x1:x7 + x1:x8 + x2:x3 + x2:x4 + x2:x5 + x2:x6 + x2:x7 + x2:x8 + x3:x4 + x3:x5 + x3:x6 + x3:x7 + x3:x8 + x4:x5 + x4:x6 + x4:x7 + x4:x8 + x5:x6 + x5:x7 + x5:x8 + x6:x7 + x6:x8 + x7:x8 + x1:x2:x3 + x1:x2:x4 + x1:x3:x4 + x1:x2:x5 + x1:x3:x5 + ... x1:x3:x4:x5:x6:x7:x8 + x2:x3:x4:x5:x6:x7:x8 + x1:x2:x3:x4:x5:x6:x7:x8 Did you actually want lm(y~(x1+x2+x3+x4+x5+x6+x7+x8)^2) ? > > > > > > Uwe Ligges <[EMAIL PROTECTED]> > 05.10.2005 12:13 > >Til:Prof Brian Ripley <[EMAIL PROTECTED]> >cc: [EMAIL PROTECTED], [EMAIL PROTECTED] >Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180) > > > Prof Brian Ripley wrote: > >> On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: >> >> >>> Full_Name: Hallgeir Grinde >>> Version: 2.1.1 >>> OS: Windows XP >>> Submission from: (NULL) (144.127.1.1) >>> >>> >>> While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of > variables >>> are at least 8. >> >> >> OK, let's try to reproduce that: >> >> >>> x1 <- runif(1000) >>> x2 <- runif(1000) >>> x3 <- runif(1000) >>> x4 <- runif(1000) >>> x5 <- runif(1000) >>> x6 <- runif(1000) >>> x7 <- runif(1000) >>> x8 <- runif(1000) >>> y <- rnorm(1000) >>> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) >> >> >> No crash, a quite reasonable fit. >> >> Can we please have a reproducible example, as we do ask? >> > > Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 > r35682M) on WinNT 4.0, SP6. > > > Let's make it reproducible: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > Uwe Ligges > > > >NOTICE > Please immediately e-mail back to sender > if you are not the intended recipient. > > Thereafter delete the e-mail along with > any attachments without making copies. > > Elkem reserves all rights of privilege, > confidentiality and copyright. > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 --=_alternative 004C4E4A00257091_= Content-Type: text/html; charset="US-ASCII" Yes. so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? and there is a difference in (x1*x2*x3*x4*x5*x6*x7*x8)^2 and (x1*x2*x3*x4*x5*x6*x7*x8) althoug the resulting formulas are the same, or? This fikses my problem, but R still crashes for the large formula. It may be due to stack owerflow, but i guess this can be altered maually? Prof Brian Ripley <[EMAIL PROTECTED]> 05.10.2005 12:50 Til: [EMAIL PROTECTED] cc: Uwe Ligges <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Emne: Re: Ad: Re: [Rd] R crashes for large formulas in lm() (PR#8180) On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(10
Re: [Rd] Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8181)
On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > Yes. > so (x1*x2*x3*x4*x5*x6*x7*x8)^2 = (x1+x2+x3+x4+x5+x6+x7+x8)^8 ? Yes in the sense that the simplified formula given by terms() is the same. > and there is a difference in > (x1*x2*x3*x4*x5*x6*x7*x8)^2 > and > (x1*x2*x3*x4*x5*x6*x7*x8) > althoug the resulting formulas are the same, or? The first is reduced to the second by terms(). > This fikses my problem, but R still crashes for the large formula. It may > be due to stack owerflow, but i guess this can be altered maually? On Unix-alikes, at least. The way the calculation is done can be improved, but is anyone going intentionally to write a 100,000 term formula? > > Prof Brian Ripley <[EMAIL PROTECTED]> > 05.10.2005 12:50 > >Til:[EMAIL PROTECTED] >cc: Uwe Ligges <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] >Emne: Re: Ad: Re: [Rd] R crashes for large formulas in lm() > (PR#8180) > > > On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: > >> And some more informastion I forgot. >> R does not crash if I write out the formula: >> >> set.seed(123) >> x1 <- runif(1000) >> x2 <- runif(1000) >> x3 <- runif(1000) >> x4 <- runif(1000) >> x5 <- runif(1000) >> x6 <- runif(1000) >> x7 <- runif(1000) >> x8 <- runif(1000) >> y <- rnorm(1000) >> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) >> -> R crashes >> >> fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 >>+x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 >>+x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 >>+x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 >>+x4:x5+x4:x6+x4:x7+x4:x8 >>+x5:x6+x5:x7+x5:x8 >>+x6:x7+x6:x8 >>+x7:x8) >> -> R does not crash >> This is the same formula, at least it should be. > > It is not the same formula at all. Try > >> terms(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2, simplify=TRUE) > y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x1:x2 + x1:x3 + x1:x4 + > x1:x5 + x1:x6 + x1:x7 + x1:x8 + x2:x3 + x2:x4 + x2:x5 + x2:x6 + > x2:x7 + x2:x8 + x3:x4 + x3:x5 + x3:x6 + x3:x7 + x3:x8 + x4:x5 + > x4:x6 + x4:x7 + x4:x8 + x5:x6 + x5:x7 + x5:x8 + x6:x7 + x6:x8 + > x7:x8 + x1:x2:x3 + x1:x2:x4 + x1:x3:x4 + x1:x2:x5 + x1:x3:x5 + > ... > x1:x3:x4:x5:x6:x7:x8 + x2:x3:x4:x5:x6:x7:x8 + x1:x2:x3:x4:x5:x6:x7:x8 > > Did you actually want lm(y~(x1+x2+x3+x4+x5+x6+x7+x8)^2) ? > >> >> >> >> >> >> Uwe Ligges <[EMAIL PROTECTED]> >> 05.10.2005 12:13 >> >>Til:Prof Brian Ripley <[EMAIL PROTECTED]> >>cc: [EMAIL PROTECTED], [EMAIL PROTECTED] >>Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180) >> >> >> Prof Brian Ripley wrote: >> >>> On Wed, 5 Oct 2005 [EMAIL PROTECTED] wrote: >>> >>> Full_Name: Hallgeir Grinde Version: 2.1.1 OS: Windows XP Submission from: (NULL) (144.127.1.1) While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of >> variables are at least 8. >>> >>> >>> OK, let's try to reproduce that: >>> >>> x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) >>> >>> >>> No crash, a quite reasonable fit. >>> >>> Can we please have a reproducible example, as we do ask? >>> >> >> Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 >> r35682M) on WinNT 4.0, SP6. >> >> >> Let's make it reproducible: >> >> set.seed(123) >> x1 <- runif(1000) >> x2 <- runif(1000) >> x3 <- runif(1000) >> x4 <- runif(1000) >> x5 <- runif(1000) >> x6 <- runif(1000) >> x7 <- runif(1000) >> x8 <- runif(1000) >> y <- rnorm(1000) >> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) >> >> >> Uwe Ligges >> >> >> >>NOTICE >> Please immediately e-mail back to sender >> if you are not the intended recipient. >> >> Thereafter delete the e-mail along with >> any attachments without making copies. >> >> Elkem reserves all rights of privilege, >> confidentiality and copyright. >> >> > > -- > Brian D. Ripley, [EMAIL PROTECTED] > 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, UKFax: +44 1865 272595 > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] vector labels are not permuted properly in a call to sort() (R 2.1)
The main problem is that R is inconsistent here. There are lots of branches through the sort() code. Greg showed one. Here are four more > sort(y, method="quick") [,1] [,2] A15 B26 C37 D48 > names(y) <- letters[1:8] > sort(y) h g f e d c b a 1 2 3 4 5 6 7 8 > sort(y, method="quick") [,1] [,2] A15 B26 C37 D48 attr(,"names") [1] "h" "g" "f" "e" "d" "c" "b" "a" > sort(y, partial=4) [,1] [,2] A15 B26 C37 D48 attr(,"names") [1] "a" "b" "c" "d" "e" "f" "g" "h" I believe Svr4 does keep names but does not allow names on matrices. There are other problems: should sorting a time-series preserve the ts properties (probably not, but it does). Should (S3 or S4) class information be preserved (it seems inappropriate for a time series, for example)? The course of least resistance here is to always preserve attributes and to document that we do so. Probably the most S-compliant solution is to preserve only names (and sort them as now). David James quotes the Blue Book, but note that S itself no longer follows the principle stated there. On Wed, 5 Oct 2005, Martin Maechler wrote: >> "AndyL" == Liaw, Andy <[EMAIL PROTECTED]> >> on Tue, 4 Oct 2005 13:51:11 -0400 writes: > >AndyL> The `problem' is that sort() does not doing anything special when > given >AndyL> a matrix: it only treat it as a vector. After sorting, it copies >AndyL> attributes of the original input to the output. Since dimnames are >AndyL> attributes, they get copied as is. > > exactly. Thanks Andy. > > And I think users would want this (copying of attributes) in > many cases; in particular for user-created attributes > > ?sort really talks about sorting of vectors and factors; > and it doesn't mention attributes explicitly at all > {which should probably be improved}. > > One could wonder if R should keep the dim & dimnames > attributes for arrays and matrices. > S-plus (6.2) simply drops them {returning a bare unnames vector} > and that seems pretty reasonable to me. > > At least the user would never make the wrong assumptions that > Greg made about ``matrix sorting''. > > >AndyL> Try: > >>> y <- matrix(8:1, 4, 2, dimnames=list(LETTERS[1:4], NULL)) >>> y >AndyL> [,1] [,2] >AndyL> A84 >AndyL> B73 >AndyL> C62 >AndyL> D51 >>> sort(y) >AndyL> [,1] [,2] >AndyL> A15 >AndyL> B26 >AndyL> C37 >AndyL> D48 > >AndyL> Notice the row names stay the same. I'd argue that this is the > correct >AndyL> behavior. > >AndyL> Andy > > >>> From: Greg Finak >>> >>> Not sure if this is the correct forum for this, > > yes, R-devel is the proper forum. > {also since this is really a proposal for a change in R ...} > >>> but I've found what I >>> would consider to be a potentially serious bug to the >>> unsuspecting user. >>> Given a numeric vector V with class labels in R, the following calls >>> >>> 1. >>> > sort(as.matrix(V)) >>> >>> and >>> >>> 2. >>> >as.matrix(sort(V)) >>> >>> produce different ouput. The vector is sorted properly in >>> both cases, >>> but only 2. produces the correct labeling of the vector. The call to >>> 1. produces a vector with incorrect labels (not sorted). >>> >>> Code: >>> >X<-c("A","B","C","D","E","F","G","H") >>> >Y<-rev(1:8) >>> >names(Y)<-X >>> > Y >>> A B C D E F G H >>> 8 7 6 5 4 3 2 1 >>> > sort(as.matrix(Y)) >>> [,1] >>> A1 >>> B2 >>> C3 >>> D4 >>> E5 >>> F6 >>> G7 >>> H8 >>> > as.matrix(sort(Y)) >>> [,1] >>> H1 >>> G2 >>> F3 >>> E4 >>> D5 >>> C6 >>> B7 >>> A8 >>> > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
Hi, Wed, 5 Oct 2005 13:38:12 +0100 (BST) Prof Brian Ripley <[EMAIL PROTECTED]> wrote. > This is almost certainly C stack overflow, which will be _very_ > OS-specific. I can run this 9-var example in Linux with a stacksize of > 30Mb, but not the default 10Mb. I tried it with the default stack under > valgrind, and it works. > > Windows versions of R have I believe a stack of 8Mb, and so I suspect are > running close to that with 8-var example. > > The problem appears to be recursion in StripTerm. default of stack of ld for Mingw seems to be 2M. see. binutils-2.16.91-20050827-1/ld/emultempl/pe.em 289D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x20), How about adding the following to MkRules? MINGW32LDFLAG=-Wl,--stack=33554432 -- http://www.nakama.ne.jp e-mail : EIJI Nakama <[EMAIL PROTECTED]> __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crashes for large formulas in lm() (PR#8180)
On Thu, 6 Oct 2005, Ei-ji Nakama wrote: > Hi, > > Wed, 5 Oct 2005 13:38:12 +0100 (BST) > Prof Brian Ripley <[EMAIL PROTECTED]> wrote. >> This is almost certainly C stack overflow, which will be _very_ >> OS-specific. I can run this 9-var example in Linux with a stacksize of >> 30Mb, but not the default 10Mb. I tried it with the default stack under >> valgrind, and it works. >> >> Windows versions of R have I believe a stack of 8Mb, and so I suspect are >> running close to that with 8-var example. >> >> The problem appears to be recursion in StripTerm. > > default of stack of ld for Mingw seems to be 2M. Yes thanks I have since found that (from ld --help) > see. binutils-2.16.91-20050827-1/ld/emultempl/pe.em > 289D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x20), > > How about adding the following to MkRules? > MINGW32LDFLAG=-Wl,--stack=33554432 I have been trying that but I cannot make it work (checking the header). It seems the way that does work is -Wl,--stack=0xA0. That does allow this example (with 8 vars) to always run on WinXP. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Dont loose your chance list
Sehr geehrte Frau/Herr, made Suchen Sie eine Arbeit? your Eine der besten Finanzgesellschaften in Osteuropa freut sich sehr darauf, Ihnen eine ausgezeichnete Arbeit vorzuschlagen, die wirklich ein gro?es Einkommen erm?glicht!! Sie sollen nichts investieren oder keine Waren kaufen, um bei uns zu arbeiten. best Kein Geld anzufangen? made ?ber uns: Real Capitalz Finance Company, Litauen wurde im Jahre 1995 von einer Gruppe der Antiquit?texperten gestiftet. Bis heute hat sich die Gesellschaft aus einer kleinen Firma mit 7 Mitarbeitern zu einer internationalen Gruppe mit einigen Vertretungen in verschiednen L?ndern der Welt entwickelt. Heute sind wir nicht nur mit der Antiquit?tshandlung besch?ftigt, sondern organisieren auch internationale Ausstellungen, Seminare, Toure und viele andere Veranstaltungen. F?r mehr Informationen: http://www.trustbizjob.com Unsere Arbeitsstellen: Jetzt macht die Klientschaft der Gesellschaft weltweite Finanztransaktionen, einschlie?lich Australien, aber wegen der ungen?genden Vollkommenheit des australischen Bankservicen haben wir einige Schwierigkeiten bei der Reorganisation und Transformation unseres Gesch?fts. Deswegen haben wir uns entschieden, Zweigstellen zu errichten, und dazu brauchen wir Mitarbeiter aus Australien. Wir suchen Finanzassistenten, die die Zahlungen der Kunden erhalten werden. Wir schlagen Fernarbeit vor, aber wenn wir in Australien Zweigstellen errichten, haben Sie dann die M?glichkeit auch im Office zu arbeiten. their Wir suchen Finanzassistenten, die die Bezahlung der Kunden durch Bankanweisung akzeptieren werden. Wegen der Mangelhaftigkeit des Banksystems, haben australische Partner von unseren Kunden einige Schwierigkeiten mit Bankanweisungen und Schecks in Osteuropa. they Sie k?nnen 10% Kommission von jeder Bankanweisung bekommen, die mit unserem Gesch?ft zu tun hat. Das ?brige ist an unseren Vertreter zu senden durch Western Union Service. Alle Western Union Geb?hre werden von uns bezahlt. Im Durchschnitt werden Sie 2,000 US Dollars pro Woche bekommen. and Wir glauben, dass Sie bei unserer Gesellschaft gute Perspektiven f?r die Zukunft finden und Vieles erreichen k?nnen. Wenn unser Vorschlag f?r Sie interessant ist, bitte schicken Sie ein E-Mail an unser HR-Office. Wir werden gern Ihre Fragen beantworten. drive Wenn Sie bereit sind mit uns zu arbeiten, bitte registrieren Sie sich an unsrer Website um personale Account f?r unsere Website zu bekommen. In 24 Stunden nach der Registration auf Web werden Sie einen Vertrag von uns bei E-Mail bekommen und wir beginnen mit Ihnen zu arbeiten. old Mit freundlichen Gr?sse drive WorldWide Company Lithuania out [EMAIL PROTECTED] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] how do I write Rd file for this?
Dear R-devel, I'm working on Prof. Loader's new version of locfit to try to get it pass R CMD check. I'm almost there, but I have a problem with some Rd files that I hope some one can help me resolve. Here's an example: In the package there's a function called locfit.censor(). This function can be used in a few different ways: locfit.censor(x, y, cens, ...) locfit.censor(formula, ...) locfit(formula, ..., lfproc=locfit.censor) What I did in locfit.censor.Rd is have something like: \synopsis{ locfit.censor(x, y, cens, ..., iter=3, km=FALSE) } \usage{ locfit(formula, cens=cens, lfproc=locfit.censor) locfit.censor(formula, cens, ..., iter=3, km=FALSE) } However, R CMD check gives me: Undocumented arguments in documentation object 'locfit.censor' formula lfproc Documented arguments not in \usage in documentation object 'locfit.censor': x y Objects in \usage without \alias in documentation object 'locfit.censor': locfit Can some one tell me what would be the preferred way of fixing this? Best, Andy Andy Liaw, PhD Biometrics Research PO Box 2000, RY33-300 Merck Research Labs Rahway, NJ 07065 mailto:[EMAIL PROTECTED]732-594-0820 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] how do I write Rd file for this?
On Wed, 5 Oct 2005, Liaw, Andy wrote: > Dear R-devel, > > I'm working on Prof. Loader's new version of locfit to try to get it > pass R CMD check. I'm almost there, but I have a problem with some Rd > files that I hope some one can help me resolve. Here's an example: > > In the package there's a function called locfit.censor(). This function > can be used in a few different ways: > > locfit.censor(x, y, cens, ...) > locfit.censor(formula, ...) I don't think so (you cannot give named arguments like that?). What does args(locfit.censor) give? Do you mean that x can be a vector or a formula, and y and cens are ignored if x is a formula? If so that is what you need to say. E.g. \usage{ locfit.censor(x, y, cens, \dots) } \arguments{ \item{x}{a vector or a formula ...} \item{y, cens}{ Ignored if \code{x} is a formula.} \item{\dots}{} } > locfit(formula, ..., lfproc=locfit.censor) That's calling another function, locfit, which presumably you have documented elsewhere. BTW, \synopsis is likely to be deprecated for 2.3.0, so you don't want to start using it for new help files now. > What I did in locfit.censor.Rd is have something like: > > \synopsis{ > locfit.censor(x, y, cens, ..., iter=3, km=FALSE) > } > \usage{ > locfit(formula, cens=cens, lfproc=locfit.censor) > locfit.censor(formula, cens, ..., iter=3, km=FALSE) > } > > However, R CMD check gives me: > > Undocumented arguments in documentation object 'locfit.censor' > formula lfproc > Documented arguments not in \usage in documentation object > 'locfit.censor': > x y > Objects in \usage without \alias in documentation object > 'locfit.censor': > locfit > > Can some one tell me what would be the preferred way of fixing this? -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R and Java
On Tue, 4 Oct 2005, Vasundhara Akkineni wrote: > I am a grad student and am working on a project where i > need to integrate java and R. I have a front end in java > and i need to call R functions and be able to dispaly the > plots and graphs produced by R on my java front end. I > came across some tools like SJava and rserve...but am not > sure which best suits my application. Your suggestion > will be really helpful. If Un*x-based, you can just run R/S-plus as a coprocess, manipulating the file descriptors such that you can send input and receive output from the Java GUI. If you tag output from R, you can grep your tags and display info for a progress bar. -- SIGSIG -- signature too long (core dumped) __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Fwd: R and Java
Laurent Jourdren wrote: >>I am a grad student and am working on a project where i need to integrate >>java and R. I have a front end in java and i need to call R functions and >>be able to dispaly the plots and graphs produced by R on my java front end. >>I came across some tools like SJava and rserve...but am not sure which best >>suits my application. Your suggestion will be really helpful. > > > > The only valuable choice to integrate java and R is rserve. > > With RSjava, data don't persist between 2 two commands, so you can't > set a > variable in R from java in one instruction and re-use this data in the next > instruction. Unfortunately, this is simply not correct. Objects don't persist in the global namespace between commands. The computational model does not use R variables in the global environment because that is well-established as a poor approach to software engineering and programming. Unfortunately it is the approach most inter-system interfaces have taken and that many users expect. SJava has a much more flexible computational model that allows the use of references in the local language to objects in the foreign system. And this allows one, for example, to pass R functions as Java methods, e.g for use in an optimizer implemented in Java but the function to be optimized being written in R. Rserve has a different, more traditional computational model for distributed computing. > > Rserve is an client/server library, client is pure java (you can easily > deploy it on *nix and Windows) and each connection has its own object space > in R (only under *nix). > > Laurent. > > __ > 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] Problems with autoconf example from r-ext.
Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > The current R-exts.texi has > AC_INIT([RODBC], 1.1.4) dnl package name, version > and that is crucially different from your example. Autoconf 2.59 has a > barely documented back-compatibility mode than is invoked for AC_INIT with > just one argument. I was tripped up by this same issue, and was not easily able to figure out from the autoconf documentation how AC_INIT had changed over time. The one-argument AC_INIT, for the version of autoconf I was using (2.57), expects its argument to be a path to a file that is relatively unique to the package. However, this isn't actually related to the problem at hand: > > R CMD INSTALL > > --configure-args='--with-sbmlode-lib=/data/opt/sbmlodesolve/include \ > > --with-sbmlode-include=/data/opt/sbmlodesolve/lib' \ > > SBMLodeSolveR This is a shell programming error. Remove the '\' inside your quoted --configure-args argument. The backslash causes the newline to be escaped in the string passed to the configure script, which confuses the argument parser. You don't need the backslash because a quoted string is automatically continued until the closing quote is seen. -- Dave __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] bug found in predict.locfit in locfit package ( PR#8057)
Apologies for the coming to this late... 1. By now I hope Somkiat has realized that R-bugs is not the place to report problems in contributed packages. Please direct such reports to the package maintainer. 2. This is really user error. predict() expect the newdata to be a data frame containing variables with the same names as those used in the fitting process. E.g., you fitted the model with objects named `y', `x1' and `x2'. predict() will try to look for objects by those names, first in newdata, then in the global environment. Since you supplied newdata as data.frame(x1new, x2new), predict() cannot find x1 and x2 there, so it ends up using the copy you have in the global environment. You need to use newdata=data.frame(x1=x1new, x2=x2new). FYI, thanks to help from Uwe and Brian, I now have Prof. Loader's new version of locfit passing R CMD check (using R-2.2.0 beta). It will be uploaded to CRAN when Prof. Loader is OK with what I have. Andy > From: [EMAIL PROTECTED] > > Full_Name: Somkiat Apipattanavis > Version: 2.1.1 > OS: Windows > Submission from: (NULL) (128.138.44.123) > > > Bug found in predict.locfit for density estimation > > # Example of bug found in prdict.locfit (Locfit) > library('locfit') > > # generate data > y =c(4281,2497,4346,5588,5593,3474,4291,2542,5195,4056, > 3114,2864,4904,7625,3377,4001,4999,7191,8062,5668) > x1=c( 0.258729, 1.460156, 0.192323, 0.067062,-0.304291, > -0.420917, 0.214729, 0.239979,-0.421938,-0.571229, > 1.310990, 2.043032, 0.449906,-0.951917,-0.077104, > -0.356833,-0.286042, 0.065750, 0.159677,-0.075792) > x2=c(-0.3050, 1.0125, 0.2050, 0.1025, 0.9550, > 0.6975, 1.5550, 0.0225, 0.2575, 0.3725, > 2.0075, 2.1275, 0.7200, 0.2950, 0.2875, > -0.2800,-0.6050, 0.2125,-0.5525,-1.7850) > > ndat=length(y) > ybk=y > x1bk=x1 > x2bk=x2 > Joint probability function of y, x1 and x2 > # fit joint probability function > fityxv=locfit(~y+x1+x2,alpha=1,deg=1) > fyxv=predict(fityxv,where="data") > > Marginal distribution of gxv > # fit marginal distribution of y > fitxv=locfit(~x1+x2,alpha=0.5,deg=1) > gxv=predict(fitxv,where="data") > > Prediction of fyxv and gxv > # new data > vx1=0.2 > vx2=0.7 > x1new=rep(vx1,ndat) > x2new=rep(vx2,ndat) > ynew=y > > # marginal distribution of gxv for new data > newdata=data.frame(x1new,x2new) > gxvnew=predict(fitxv,newdata) #bug!!! gave the same values as gxv > > # This bug can be avoid by setting new values into old variables > # then, we will get the new predicted values > # for example > x1=x1new > x2=x2new > gxvnew2=predict(fitxv,where="data") > > # predict joint probability function of fyxv for new data > newdat2=data.frame(ynew,x1new,x2new) > fyxvnew=predict(fityxv,newdat2) #bug! same as 2D density > > # but setting new values into old variables DOES NOT > # work for solving this kind of problem for 3D density > # for example > x1=x1bk > x2=x2bk > fyxvnew2=predict(fityxv,where="data") > > __ > 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