From cberry at tajo.ucsd.edu  Wed Jul 21 19:37:55 2004
From: cberry at tajo.ucsd.edu (cberry@tajo.ucsd.edu)
Date: Wed Jul 21 19:38:04 2004
Subject: [Rd] loglin( tab, margin, start = bad.start ) kills R (PR#7123)
Message-ID: <20040721173755.11747FC0D@slim.kubism.ku.dk>



> tab <- array( sample(3^5), rep(3,5) )
> loglin( tab, list(1,2,3,4,5) )[[1]] # AOK
2 iterations: deviation 5.456968e-12 
[1] 10909.89
> loglin( tab, list(1,2,3,4,5), c(1,2,3) )[[1]] # OUCH!

Process R bus error at Wed Jul 21 17:03:55 2004


this is inconsistent - sometimes issuing this msg several times before 
barfing:

Error in switch(z$ifault, stop("This should not happen"), stop("This 
should not happen"),  : 
	Incorrect specification of 'table' or 'start'


appl/loglin.c assumes that start (aka 'fit') has enough memory allocated.

Possible fix in stats/R/loglin.R :

    	ntab <- length(table)
+	nstart <- length( start )
+	if (nstart != ntab ) stop(" start and table must be same length " )




> version
         _                      
platform sparc-unknown-linux-gnu
arch     sparc                  
os       linux-gnu              
system   sparc, linux-gnu       
status                          
major    1                      
minor    9.0                    
year     2004                   
month    04                     
day      12                     
language R          

and with windows 98 rw1091.exe version, I get the popup for illegal 
operation. Again, I sometimes get the above error msg first.

Chuck


Charles C. Berry                        (858) 534-2098 
                                         Dept of Family/Preventive Medicine
E mailto:cberry@tajo.ucsd.edu	         UC San Diego
http://hacuna.ucsd.edu/members/ccb.html  La Jolla, San Diego 92093-0717


[Rd] loglin( tab, margin, start = bad.start ) kills R (PR#7123)
cberry@tajo.ucsd.edu