I have a geom_gene_arrow plot and I need to use ggrepel to prevent labels from overlapping. Unfortunately, I haven't been able to get it to work and get and error saying 'could not find function "geom_text_repel"'
Working example with only geom_text:
> ggplot(data, aes(xmin = start, xmax = end, y = genome, fill = colour, forward = direction)) +
geom_gene_arrow() +
geom_text(aes(x = end - ((end-start)/2), y = 1.2, label = gene, angle=90)) +
facet_wrap(~ genome, scales = "free", ncol = 1) +
theme_void()+
xlab("")
And with the introduction of geom_text_repel it fails.
> ggplot(data, aes(xmin = start, xmax = end, y = genome, fill = colour, forward = direction)) +
geom_gene_arrow() +
geom_text_repel(aes(x = end - ((end-start)/2), y = 1.2, label = gene, angle=90)) +
facet_wrap(~ genome, scales = "free", ncol = 1) +
theme_void()+
xlab("")
example data:
genome start end gene function colour direction
A 11638 12786 fadA6 ringdegradation green, -1
A 12798 13454 fadE30 cleavage, blue 1
A 13529 14341 fadD3 ringdegradation green -1
Any insight as to what I am doing wrong is greatly appreciated!