Scale_x_date date_breaks 1st and 15th of the month

I'd recommend making a little helper function to make this easier. Something along these lines:

bimonthly <- function(x) {
  x_range <- range(x, na.rm = TRUE)
  
  date_range <- c(
    floor_date(x_range[1], "month"),
    ceiling_date(x_range[2], "month")
  )
  monthly <- seq(date_range[1], date_range[2], by = "1 month")
  
  sort(c(monthly, monthly + days(14)))
}

Then you can use that function as the argument to breaks:

ggplot(Effort_Combined_HI, aes(Date, hours)) +
  geom_bar(stat = "identity", width = 1) + 
  scale_x_date(breaks = bimonthly)
1 Like