title: How do I change months from numeric (ex.month 1,month 1) to name (ex. Jan,Feb) in R?
body: <p>I have trouble in changing the month from numeric to name in the x-axis (refer to picture). Below are my code. I want to change the month (1,2,3,4,..) to (Jan,Feb,Mar,...) in the x-axis.
  <a href="https://i.stack.imgur.com/kvHcK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kvHcK.png" alt="enter image description here" /></a></p>
  <pre><code>dd &lt;- data.frame(beginning=c(6,6,6,7,7,8),
                   end=c(7,7,7,7,7,12),
                   solution=c(&quot;death&quot;, &quot;death&quot;,&quot;death&quot;,&quot;death&quot;,&quot;death&quot;,&quot;recovered&quot;)
  )
  dd$id &lt;- c(1:length(dd[,1]))
  par(mfcol=c(1,1), mar=c(5,5,1.6,1),cex.lab=1)
  plot(id~beginning, data=dd,
       xlim=c(1,12), ylim=c(0, max(dd$id)+2),# axis limits
       pch=NA, # dont plot points yet
       yaxt=&quot;n&quot;, xaxt=&quot;n&quot;, 
       xlab=&quot;Month&quot;, ylab=&quot;Case No.&quot;)
  axis(side=2, at=dd$id, labels=dd$id, las=1)
  axis(side=1,
       at=seq(1,12, by=1),
       labels=seq(1,12, by=1))
  with(dd, arrows(y0=id, x0=beginning, y1=id, x1=end, length = 0))
  with(dd, points(beginning, id, pch=25, bg=&quot;red&quot;, cex=1.5))
  dd$my.pch &lt;- ifelse(dd$solution==&quot;recovered&quot;,24,4)
  with(dd, points(end, id, pch= my.pch, bg=&quot;green&quot;, cex=1.5))
  legend(&quot;topleft&quot;, legend=c(&quot;ill&quot;, &quot;recovered&quot;, &quot;death&quot;),
         pch=c(25,24,4),
         pt.bg= c(&quot;red&quot;, &quot;green&quot;, &quot;black&quot;),
         bty=&quot;n&quot;
  )
  </code></pre>