Skip to content

request: most repeated sequnce

2 messages · Muhammad Azam, jim holtman

#
Here is a start.  You can delete the zeros:
+ 0,0,0,0,0,0,1,2,2,2,2,2,0,3,3,0,4,4,0,0,0,0,0,0)
+     rows <- table(apply(.mat,1,function(z){
+         paste(z,collapse=' ')
+     }))
+     names(rows[which.max(rows)])
+ })
[1] "1 0 0 0 0 0" "1 2 3 0 0 0" "1 2 3 4 0 0" "1 2 3 4 0 0" "2 2 3 4 0 0"

        
On Sat, Sep 6, 2008 at 4:54 AM, Muhammad Azam <mazam72 at yahoo.com> wrote: