Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. CHR POS
  2. 1 2
  3. 1 4
  4. 1 6
  5. . .
  6. . .
  7. 1 30
  8. . .
  9. . .
  10. . .
  11. 22 150
  12. 22 162
  13. 22 170
  14. 22 185
  15.  
  16. > df_split <- split(df, f=df$CHR)
  17.  
  18. # then I generate a function, involving "cut" function
  19.  
  20. > bins <- function(df){
  21. lower <- min(df$POS)
  22. upper <- max(df$POS)
  23. cut(df$POS, seq(lower,upper, 10))
  24. }
  25.  
  26. # finally i used lapply, incorporating my personalizad "cut" function
  27.  
  28. > bin_1 <- lapply(df_split, bins)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement