I have a continuous y-axis that needs values relabelled into time on a 12-hour AM/PM clock. I would prefer not to change the actual variable into time because that would make the statistics exceedingly difficult. Currently, time on my graph is measured in hours since the previous midnight.
For example:
22 = 10pm
25 = 1am
28 = 4am
My current ggplot graphing code is:
ggplot(fwb_merged1, aes(x = age, y = midslp, color = fhr)) +
geom_point(shape = 20, alpha = 0.35) +
scale_color_manual(name="Family High Risk Status",
labels=c("Control","Family High Risk"),
values=c("#5a9abf","#EB515E")) +
geom_smooth(method = "lm", fill = NA) +
ggtitle("Sleep Midpoint vs Age by FHR") +
xlab ("Age") + ylab("Sleep Midpoint (Hours since Previous Midnight)")
How can I modify this code to allow me to either manually change the values on the y axis or transpose my current values into time for the graph?