Last active
December 8, 2017 01:03
-
-
Save danielecook/1cb76558fda8c01fc85c014afda28b18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_df %>% | |
dplyr::arrange(chromosome, isotype, start, stop) %>% | |
dplyr::filter( | |
(!(lead(start) == stop & lead(haplotype) == haplotype & lead(isotype) == isotype & lead(chromosome) == chromosome) | is.na(lag(start)) | is.na(lead(stop))) | |
) %>% | |
dplyr::mutate(stop = ifelse(lead(isotype) == isotype & | |
lead(haplotype) == haplotype & | |
!is.na(lead(stop)), | |
lead(stop), | |
stop) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment