[R] any statement equals to 'goto'?

karena dr.jzhou at gmail.com
Tue Aug 31 20:34:44 CEST 2010


I have the following code:
-----------------------------------------------------------------------------------------------------
result <- matrix(NA, nrow=1, ncol=5)
for(i in 1:(nsnp-1)) {
  for(j in (i+1):nsnp){
tempsnp1 <- data.lme[,i]
tempsnp2 <- data.lme[,j]
fm1 <- lme(trait~sex+age+rmtemp.b+fc+tempsnp1+tempsnp2+tempsnp1*tempsnp2,
random=~1|famid, na.action=na.omit)
fm2 <- lme(trait~sex+age+rmtemp.b+fc+tempsnp1+tempsnp2, random=~1|famid,
na.action=na.omit)
result[1,1] <- i
result[1,2] <- j
result[1,3] <- colnames(data.lme)[i]
result[1,4] <- colnames(data.lme)[j]
result[1,5] <- 2*(summary(fm1)$logLik-summary(fm2)$logLik)
if (i==1 & j==2) results <- result
if (i!=1 | j!=2) results <- rbind(results, result)
}
-----------------------------------------------------------------------------------------------------

after submitting this code, I got the error message saying "Error in
MEEM(object, conLin, control$niterEM) : 
Singularity in backsolve at level 0, block 1", I know this might be some
issue due to the missing values. what I want to do is to skip the 'bad'
variable, for example, I got this error message when j=116, so I just wanna
ignore variable116, is there a statement that can do this: when getting this
error message 'Error in MEEM...........', directly goto the next variable?

thank you,

karena



-- 
View this message in context: http://r.789695.n4.nabble.com/any-statement-equals-to-goto-tp2402107p2402107.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list