Created
May 4, 2020 12:11
-
-
Save danielecook/51f89f309ef89bedd02cf68cebb1baf5 to your computer and use it in GitHub Desktop.
Chromosome order as a factor in R
This file contains hidden or 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
# For chr_order with 'chr' prefix | |
# chr_order <- paste0("chr", c((1:22),"X","Y","M")) | |
chr_order <-c((1:22),"X","Y","M") | |
df$chrom <- factor(df$chrom, chr_order, ordered=TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment