title: Improving Barplot Function Regex and Labels
body: <p>Can you help me (i) tidy the code so that the 2 regex lines indicated can be done in one, and (ii) the titles can be placed over the bars (or maybe at an angle) so that they all fit.</p>
  
  <pre><code>##  Web Scraping DUP
  ##  to plot a barchart of poem reads
  
  ## Download the webpage
  
  NoPoemsRead &lt;- function(x){
    poems &lt;- readLines(x)
    ## Extract out the title lines
  
    poem_title &lt;- poems[grep("&lt;h2", poems)[-1]]
  
    ## Extract out the number of reads lines
  
    poem_reads &lt;- poems[grep("reads&lt;/small", poems)]
  
    ## De-clutter work space
  
    rm(poems)
  
    ## tidy up the data
    poem_reads &lt;- unlist(lapply(poem_reads, function(x) as.numeric(gsub("[^0-9]+","",x))))
  
    ## the two lines below could be done in one
    poem_title &lt;- unlist(lapply(poem_title, function(x) gsub("\t\t\t\t\t\t\t\t\t\t&lt;.*?&gt;", "", x)))
    poem_title &lt;- unlist(lapply(poem_title, function(x) gsub("&lt;.*?&gt;", "", x)))
  
    names(poem_reads) &lt;- poem_title
  
    barplot(poem_reads, las = 2,cex.names = 0.75, main = "The Number of Poems Read",
            ylab="Number of Reads", col = "skyblue")
  }
  
  NoPoemsRead("https://deepundergroundpoetry.com/poems-by/AnonymousBystander/")
  </code></pre>