Re: [R] looping in R

2014-04-02 Thread Duncan Murdoch
On 02/04/2014, 3:15 PM, Abugri James wrote: I ran the following loop on my SNP data and got an error message as indicated I would assume that the error message is accurate: as.character(current[1, "gene_old"]) has length zero. You'll need to debug why that happened. Duncan Murdoch for (i

Re: [R] looping in R

2014-04-02 Thread Jeff Newmiller
You desperately need to read the Posting Guide (mentioned in the footer of this email) which warns you not to post in HTML format, and learn how to make a reproducible example (e.g. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). The problem lies in some

[R] looping in R

2014-04-02 Thread Abugri James
I ran the following loop on my SNP data and got an error message as indicated for (i in genenames){ + current <- fst1[which(fst1$Gene == i),] + num <- nrow(current) + fst <- max(current$fst) + position <- mean(current$pos) + nposition <- mean(current$newpos) + numhigh <- nrow(current[wh