How can I plot a line for time series data with categorical intervals in R
Would something like this work? I simply add an extra column that indicates the row number (which is later used as the x-axis) to make sure all values are displayed as a new point instead of plotting on top of each other for the same day. I then specifiy the custom x ticks and labels by selecting the first row for each day and get the row number (which specifies where the ticks and labels have to be drawn) and the day name (which specifies what the labels should display).
library(readr)
library(ggplot2)

df &lt;- read_csv(&quot;testData.csv&quot;) %&gt;%
  mutate(
    date = as.Date(date, &quot;%d-%m-%Y&quot;),
    day = weekdays(date),
    row = row_number()
)
ticks &lt;- df %&gt;% group_by(day) %&gt;% filter(row_number() == 1) %&gt;% select(row)

ggplot() +
  geom_line(data = df, aes(x = row, y = value, group = 1), color = &quot;red&quot;) +
  ggtitle(&quot;Some Measure over Time&quot;) +
  xlab(&quot;Time&quot;) +
  ylab(&quot;Some Measure in %&quot;) + 
  scale_x_continuous(breaks=pull(ticks, row), labels=pull(ticks, day))