String comparison is too slow in R language

## String comparison is too slow in R language
## it will take 3 minutes, it is too slow


date()
strArray1<-rep("1234567890",10000)
strArray2<-rep("1234567890",10000)
tt<-0
for(xx in 1:10000)
{
    for(yy in 1:10000)
    {
        if(strArray1[xx]==strArray2[yy])
        {
            tt<-tt+1
        }
    
    }

}
date()

 

 



posted @ 2017-07-05 18:27  emanlee  阅读(281)  评论(0编辑  收藏  举报