Function to improve default x-axis breaks
Usage
smart_x_axis(p1, max_x = NULL, xvar = "TIMEADJ", xlabel, debug = FALSE)
Arguments
- p1
ggplot object
- max_x
Max x-axis value, will be derived from p1 if it is set to NULL
- xvar
x variable string to be used to derive max_x
- xlabel
Will only apply when xlabel is either
"Time (hours)"
"Time (weeks)",
"Time (days)",
"Time (months)
- debug
Shows debug messages