Displaying 1 result from an estimated 1 matches for "extgpl".
Did you mean:
expl
2010 Oct 04
3
vectorizing problem
...685
2315106 DQ786314
and I want to change this to look like this:
2315100 NR_024005
2315100 NR_024004
2315100 AK093685
2315106 DQ786314
I can do this with the following "for" loop but the dataframe (GPL)
has ~140,000 rows and this takes about 15 minutes:
extGPL <- matrix(nrow=0,ncol=2)
for (i in 1:length(GPL[,2])){
aa <- unlist(strsplit(as.character(GPL[i,2]),"\\,"))
bb <- rep(as.numeric(as.character(GPL[i,1])), length(aa))
cc <- matrix(c(bb,aa),ncol = 2)
extGPL <- rbind(extGPL,cc)
}
Is there a way to...