[Rd] inconsistency within within( ) (PR#11131)

2008-04-10 Thread jritter
Hello R-team ~

I ran across an inconsistency about how within( ) handles expressions 
like b<-NULL.  (I have found within( ) very handy, by the way.)  The 
problem appears to crop up when you use something like b<-NULL in the 
same within() call that creates a new variable in the data frame.  An 
example using 2.6.2 on Windows XP is below.  Version 2.6.1 had a 
different, but similar problem.

As always, thanks for a very useful piece of software.

Joe Ritter

 > a<-1:5;b<-2:6;c<-3:7
 > abc=data.frame(a,b,c)
 > within(abc,{b<-NULL})
   a c
1 1 3
2 2 4
3 3 5
4 4 6
5 5 7
 > within(abc,{d<-a+7;b<-NULL})
   a cd structure(c(" 8", " 9", "10", "11", "12"), class = "AsIs")
1 1 3 NULL  8
2 2 4   9
3 3 5  10
4 4 6  11
5 5 7  12
Warning message:
In format.data.frame(x, digits = digits, na.encode = FALSE) :
   corrupt data frame: columns will be truncated or padded with NAs
 > within(abc,{a<-a+7;b<-NULL})
a c
1  8 3
2  9 4
3 10 5
4 11 6
5 12 7

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] a new way to crash R? (PR#8981)

2006-06-14 Thread jritter
This is a multi-part message in MIME format.
--010500030900050501010804
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Dear R Team,

First, thank you for incredibly useful software!

Now the bad news:  The attached script (or the original version with 
real data) will reliably crash R on my machine.  I am using:

R version: either 2.2.1 or 2.3.1
Windows 2000 Professional, Service Pack 4
512 MB of RAM

On my machine the script will crash R on line 42 [  probits21 <- 
lapply(...  ].  

In both this script and the "real" one, memory.size() indicates that R 
is about 512 MB just before executing the command that crashes it.  In 
other contexts, R has been able to allocate virtual memory on this 
computer without any trouble.

Thanks again for all your work on R.

Regards,

Joe Ritter

--
Joseph A. Ritter
Associate Professor
Humphrey Institute of Public Affairs
University of Minnesota
Minneapolis, MN  55455
U.S.A.
612-625-0442

--010500030900050501010804
Content-Type: text/plain;
 name="crash.r"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="crash.r"

x1 <- rnorm(1)
x2 <- rnorm(1)
x3 <- rnorm(1)
x4 <- rnorm(1)
x5 <- rnorm(1)
x6 <- rnorm(1)
x7 <- rnorm(1)
x8 <- rnorm(1)
y <- round(runif(1))

specs <- list()
specs$A <- formula(y~x1+x2+x3+x4+x5+x6+x7+x8) 
specs$B <- specs$A
specs$C <- specs$A
specs$D <- specs$A
specs$E <- specs$A
specs$F <- specs$A
specs$H <- specs$A
specs$I <- specs$A
specs$J <- specs$A

probits1 <- lapply(specs, glm, family=binomial(link="probit"))  
probits2 <- lapply(specs, glm, family=binomial(link="probit"))  
probits3 <- lapply(specs, glm, family=binomial(link="probit"))  
probits4 <- lapply(specs, glm, family=binomial(link="probit"))  
probits5 <- lapply(specs, glm, family=binomial(link="probit"))  
probits6 <- lapply(specs, glm, family=binomial(link="probit"))  
probits7 <- lapply(specs, glm, family=binomial(link="probit"))  
probits8 <- lapply(specs, glm, family=binomial(link="probit"))  
probits9 <- lapply(specs, glm, family=binomial(link="probit"))  
probits10 <- lapply(specs, glm, family=binomial(link="probit"))  
probits11 <- lapply(specs, glm, family=binomial(link="probit"))  
probits12 <- lapply(specs, glm, family=binomial(link="probit"))  
probits13 <- lapply(specs, glm, family=binomial(link="probit"))  
probits14 <- lapply(specs, glm, family=binomial(link="probit"))  
probits15 <- lapply(specs, glm, family=binomial(link="probit"))  
probits16 <- lapply(specs, glm, family=binomial(link="probit"))  
probits17 <- lapply(specs, glm, family=binomial(link="probit"))  
probits18 <- lapply(specs, glm, family=binomial(link="probit"))  
probits19 <- lapply(specs, glm, family=binomial(link="probit"))  
probits20 <- lapply(specs, glm, family=binomial(link="probit"))  
probits21 <- lapply(specs, glm, family=binomial(link="probit"))  
probits22 <- lapply(specs, glm, family=binomial(link="probit"))  
probits23 <- lapply(specs, glm, family=binomial(link="probit"))  
probits24 <- lapply(specs, glm, family=binomial(link="probit"))  
probits25 <- lapply(specs, glm, family=binomial(link="probit"))  
probits26 <- lapply(specs, glm, family=binomial(link="probit"))  
probits27 <- lapply(specs, glm, family=binomial(link="probit"))  
probits28 <- lapply(specs, glm, family=binomial(link="probit"))  
probits29 <- lapply(specs, glm, family=binomial(link="probit"))  
probits30 <- lapply(specs, glm, family=binomial(link="probit"))  
probits31 <- lapply(specs, glm, family=binomial(link="probit"))  

--010500030900050501010804--

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel