Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 211995

extracting last and the second last part of url in R [closed]

$
0
0

how can extract last part and second last part (or maybe more) parts of url and put it into the new columns?

lets say

mydata:
user    view
1       https://domain.ca/courses/43/pages/general-guidelines
2       https://domain.ca/courses/43/id=33/svgl11/hi/resources
3       https://domain.ca/courses/43/505/pages/detail-specification


result:
user  secondlastPart lastPart
1        pages        general-guidelines
2        hi           resources
3        pages        detail-specification

how can I do it in R?


Viewing all articles
Browse latest Browse all 211995

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>