Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CHR POS
- 1 2
- 1 4
- 1 6
- . .
- . .
- 1 30
- . .
- . .
- . .
- 22 150
- 22 162
- 22 170
- 22 185
- > df_split <- split(df, f=df$CHR)
- # then I generate a function, involving "cut" function
- > bins <- function(df){
- lower <- min(df$POS)
- upper <- max(df$POS)
- cut(df$POS, seq(lower,upper, 10))
- }
- # finally i used lapply, incorporating my personalizad "cut" function
- > bin_1 <- lapply(df_split, bins)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement