I am plotting data over time using the following dataset:
dt1 <- data.table(
sender=c("boy", "girl", "girl", "boy", "girl", "boy"),
type = c("run", "walk", "run", "run", "run", "walk"),
time=c(as.POSIXct("2014-02-19 03:24:00"), as.POSIXct("2014-02-19 03:29:00"), as.POSIXct("2014-02-20 03:30:00"), as.POSIXct("2014-02-23 03:34:00"), as.POSIXct("2014-02-25 08:24:00"), as.POSIXct("2014-02-25 09:45:00")),
dayRelative = c(0,0,1,4,6,6))
The following ggplot command works fine:
ggplot(dt1, aes(x=time, y=sender, colour=type)) +
geom_point(size=2, position=position_jitter(width=0.2, height=0.2)) +
scale_y_discrete(limit = c("boy", "girl"), labels= c("Boy", "Girl"))

What I like to achieve is that instead of having the date labels on the x-axis, the data from the dayRelative-column should be used. That means for the dots the time-column should be used, however, the x-Axis should use the data from the dayRelative column the respective places. As a result Feb 19 should be replaced by 0, Feb 20 by 1, ...

timewithdayRelativein the call toggplot? What wil be the difference?dayRelative.timeincludes the exact time,dayRelativeonly the days passed since the beginning. I would like to have these days as labels on the x-Axis, still the dots should represent the exact times (like 9:00 on the first day).