Advertisement
ProzacR

pasalint_eilutes_80proc0

Jan 8th, 2020
910
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.47 KB | None | 0 0
  1. count_matrix<-read.csv(file = "count_matrix.csv",row.names=1)
  2.  
  3. eilsk<-nrow(count_matrix)
  4. stulpsk<-ncol(count_matrix)
  5. palikti<-NULL
  6. i<-1                
  7. while(i<=eilsk)
  8. {
  9. x<-1
  10. nenuliai<-0
  11.     while(x<=stulpsk)
  12.     {
  13.     if(count_matrix[i,x]!=0)
  14.     {
  15.     nenuliai<-nenuliai+1
  16.     }
  17.     x<-x+1
  18.     }
  19. #print(nenuliai/stulpsk)
  20. if(nenuliai/stulpsk>0.2)
  21. {
  22. palikti <- append(palikti, i)
  23. }
  24. i<-i+1
  25. }
  26. write.csv(count_matrix[palikti,], file="count_matrix_small.csv")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement