title: URL semantic analysis using R
body: <p>I have a dataset like</p>
  
  <pre><code>URL                                                       Keywords           Impressions     Clicks
  
  http://www.thetelegraphandargus.co.uk/sport/sportbcfc     sports|football      5500           456
  </code></pre>
  
  <p>I wanted to explode the data set in the following format:</p>
  
  <pre><code>URL                                       URL Keyword         Keyword         Impressions        Clicks
   http://www.thetelegraphandargus.co.uk     sport               sports           5500                456
   http://www.thetelegraphandargus.co.uk     sportbcfc           football         5500                456
  </code></pre>
  
  <p>I have tried splitting them using stringr and urltools libraries.</p>
  
  <pre><code>ee &lt;- as.character(data$URL)
  
  eee &lt;- strsplit(ee, "/")
  
  maxLen &lt;- max(sapply(eee, length))
  
  L &lt;-   t(sapply(eee, function(x)
  c(x, rep(NA, maxLen - length(x)))
    ))         
  
   F=data.frame(L)
  </code></pre>
  
  <p>and</p>
  
  <pre><code> d&lt;-url_parse(as.character(data$url))
  </code></pre>
  
  <p>I am able to split the URLs but I am not getting it in the desired format. They are being split in the same row.</p>
  
  <p>PS: I used delimiter function in excel for Keywords column with delimiter as "|"</p>