I am making CDF plots using this line of code:
library(ggplot2)
ExpDF <- data.frame(x=c('gene1','gene2','gene3','gene4'),"FC"=c(1,2,3,4))
ts_miR_15 <- data.frame(x=c('gene1','gene3','gene4'),"FC"=c(1,3,4))
ahc_miR_15_3UTR <- data.frame(x=c('gene1','gene4','gene12'),"FC"=c(1,4,12))
g <- ggplot(data = NULL)
g + geom_step(aes(x=ExpDF$FC, color="All_genes"),stat="ecdf") +
geom_step(aes(x= ts_miR_15$FC, color="Targetscan_miR-15/16"), stat="ecdf") +
geom_step(aes(x= ahc_miR_15_3UTR$FC, color="3UTR_miR-15/16_seed"), stat="ecdf") +
scale_colour_manual("Subsets", values = c("All_genes"='black',
"Targetscan_miR-15/16"='orange',
"3UTR_miR-15/16_seed"='red'))
...(etc. for each additional data.frame
I would like to be able to reorder the labels for the legend such that "All_genes" is on top (and preferably have it in any oder I want). I would prefer to keep the data.frames separate because they have different numbers of genes (which mark the rows) in them and some of them are subsets of the other.