Closed zlskidmore closed 5 years ago
Hi, is there maybe a workaround for this? I've tried adding a ggplot Layer but can't make it.
Thanks
if your sample column is a factor genvisr will instead use that ordering. That's the only work around currently, using the example dataframe loaded with genvisr:
# original plot
cnSpec(LucCNseg, genome="hg19")
# new order
LucCNseg$sample <- factor(LucCNseg$sample, levels=rev(levels(LucCNseg$sample)))
cnSpec(LucCNseg, genome="hg19")
Right, that works, thank you!
We should give the end user more control over the ordering of samples in the
cnSpec()
function. Currently the only way to control the order of facets in ggplot2 is by the order of levels for that data. The typical way to change the ordering is with the functionfactor()
however currently we enforce an alphanumeric order here: https://github.com/griffithlab/GenVisR/blob/0a04cba8acb14cec15048cd49a9043fd60bb2efb/R/cnSpec.R#L133Original request from here: https://support.bioconductor.org/p/109523/