This problem stems from a previous question. I've come across this solution:
myBreaks <- function(x){
breaks <- c(min(as.numeric(as.character(x))),max(as.numeric(as.character(x))))
names(breaks) <- attr(breaks,"labels")
breaks
}
Then adding this to the ggplot code with:
scale_x_discrete(breaks = myBreaks, labels = myBreaks) +
Which works. However, when adding median(as.numeric(as.character(x))
to the function, it throws the x-axis haywire. Is there a work around?