This is a relatively straightforward question, however, I was unable to find an answer. Likewise, I am not used to posting at Stackoverflow so I apologise for any kind of errors.
I currently have a Multiplot Facet that displays the variation in animal activity (Y) and day length on a seasonal level (in this case, two seasons).
As you see on the X axis, there are numbers such as 0.45, 0.47, etc. These represent time in numeric form. The issue is, is that I would like to convert 0.45 and etc to hours (it should be noted that they are not represented as dates). That is, 0.45 should represent 10, 0.47 should represent 10.2 etc. While I attempted to manually do this in excel...the scatter plots are well..not very scattered when plotting them. That is, I simply converted 10:02:00 to 10.2 (therefore, they do not represent actual dates in R)
Is there a way to either 1. manually change the numeric daylength (i.e. 0.45) to the hours that they represent? 2. Shorten the tick marks for the actual hours for both facets so that they do not seemed as scattered?
Likewise, is all of this possible while keeping both facets in place?
Here is the script that I use for the plot:
ii$season = factor(ii$season, levels = c("Winter","Summer"))
ii <- ii%>%
mutate(season = ifelse(month2 %in% c( 6,7, 8), "Winter",
ifelse(month2 %in% c(12,1,2), "Summer","Error")))
Plot <- ggplot(ii, aes(daylength, newavx2)) +
geom_point() + geom_smooth()+
ggtitle("Activity and Daylength by Season") +
xlab("Daylength") + ylab("Activity") +
theme(plot.title = element_text(lineheight=.8, face="bold",size = 20)) +
theme(text = element_text(size=18))
Plot + facet_grid(.~season, scales = "free_x") +
theme(strip.background = element_blank())
It should be noted that for the second plot, the variable daylength is simply replaced by 'hours' Thank you so much for your help