title: Scale x-axis in ggplot2
body: <p>I have issues with the x-axis when plotting a line graph. As the graph below indicates, I have too many labels.</p>
  
  <p><a href="https://i.stack.imgur.com/ywz0F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ywz0F.png" alt="Line graph"></a></p>
  
  <p>I try to remedy the solution by including only some labels using <code>seq()</code>, but I would come across this error:</p>
  
  <pre><code>ggplot(df, aes(x = date, y = measure, group = 1)) + 
      geom_line() + 
      theme_bw() +
      theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) + 
      xlab("X-Axis") + 
      ylab("Y-Axis") + 
      scale_x_continuous(breaks = round(seq(min(df$date), max(df$date), by = 221.2), 1))
  
  #&gt; Error in seq.default(min(df$date), max(df$date),  : 
  #&gt;   'from' must be a finite number
  #&gt; In addition: Warning message:
  #&gt; In seq.default(min(df$date), max(df$date),  :
  #&gt;   NAs introduced by coercion
  </code></pre>
  
  <p>Any suggestions? If it helps, <code>df$date</code> is considered a character. Perhaps, I should convert it to numeric or as a datetime? </p>