title: get filename from url path in R
body: <p>I would like to extract filename from url in R. For now I do it as follows, but maybe it can be done shorter like in python. assuming path is just string.</p>
  
  <pre><code>path="http://www.exanple.com/foo/bar/fooXbar.xls"
  </code></pre>
  
  <p>in R:</p>
  
  <pre><code>tail(strsplit(path,"[/]")[[1]],1)
  </code></pre>
  
  <p>in Python:</p>
  
  <pre><code>path.split("/")[-1:]
  </code></pre>
  
  <p>Maybe some sub, gsub solution?</p>