Stack Exchange
Split string using delimiter alternatively
I have a list of urls like this:    
mydata <- read.table(header=TRUE, text="
      Id
      https://www.example.com/dp/c/830216013?q=%3Arelevance%3Abrickpattern%3ADecorative%2FArt+Deco%3Abrickpattern%3AFloral%3Abrickpattern%3AGeometric%3Abrickpattern%3AGraphic%3Abrickpattern%3ATropical%3Aprice%3A300%2C10500&page=7&gridValue=4  
      https://www.example.com/dp/c/830216013?q=%3Arelevance%3Averticalsizegroupformat%3AIN%2040%3Averticalcolorfamily%3ABlack%3Averticalcolorfamily%3ABlue%3Averticalcolorfamily%3AWhite
      https://www.example.com/dp/c/830316016?q=%3Arelevance%3Averticalcolorfamily%3AWhite&gclid=CjwKEAjw9_jJBRCXycSarr3csWcSJABthk07W_H0RxQtOPZX7VdD9CSmK4S01BMYdXbtc0XxC0OeChoCky_w_wcB
      https://www.example.com/dp/c/830216013?q=%3Arelevance%3Abrand%3AFLYING%20MACHINE%3Abrand%3AMUFTI%3Abrand%3AUNITED%20COLORS%20OF%20BENETTON
      https://www.example.com/dp/c/830216013?q=%3Arelevance%3Averticalsizegroupformat%3AIN%2038%3Averticalsizegroupformat%3AIN%2039%3Averticalsizegroupformat%3AIN%20M%3Averticalsizegroupformat%3AUK%2039%3Averticalsizegroupformat%3AUK%20M%3Averticalsizegroupformat%3AUK%20S%3Averticalsizegroupformat%3AUS%20M%3Averticalsizegroupformat%3AUS%20S%3Abrickpattern%3ASolid%3Averticalcolorfamily%3ABlack%3Averticalcolorfamily%3AWhite
      https://www.example.com/dp/c/830216013?q=%3Aprce-asc%3Abricksleeve%3AShort%3Aprice%3A300%2C10500&page=2&gridValue=4
      https://www.example.com/dp/c/830216013??q=%3Aprce-asc%3Abrand%3AUS+POLO%3Abricksleeve%3AShort%3Aprice%3A300%2C10500
      https://www.example.com/dp/c/830216013?q=%3Arelevance%3Abrand%3AAJIO%3Abrand%3ABASICS%3Abrand%3ACelio%3Abrand%3ADNMX%3Abrand%3AGAS%3Abrand%3ALEVIS%3Abrand%3ANETPLAY%3Abrand%3ASIN%3Abrand%3ASUPERDRY%3Abrand%3AUS%20POLO%3Abrand%3AVIMAL%3Abrand%3AVIMAL%20APPARELS%3Abrand%3AVOI%20JEANS
      https://www.example.com/dp/c/830216013?q=%3Arelevance%3Abrand%3ABritish+Club%3Abrand%3ACelio%3Abrand%3AFLYING+MACHINE%3Aprice%3A300%2C10500&page=1&gridValue=4          
                         ")      

I need to pull out value of parameters like the brand, verticalcolorfamily, q= etc from the urls. These parameters are the filters applied on the website.
The output which i am looking for is a data frame with three columns:parameter,value and the frequency of occurrence of the value. For Ex:
parameter |      value     | frequency
----------|----------------|----------
brand     | FLYING+MACHINE | 2  
q=        | relevance      | 5  
price     | 300%2C10500    | 2  
brand     | BASICS         | 1

Currently i am able to think of is to collect each urls as a string vectors separated by alternating values of "%3A" as a delimiter:[q=%3Arelevance ,brickpattern%3ADecorative%2FArt+Deco,brickpattern%3AFloral , brickpattern%3AGeometric , brickpattern%3AGraphic , brickpattern%3ATropical , price%3A300%2C10500].
Then place each element in a column of a data frame and then again split by '%3A' and do a group by.
Suggestions on an other approach will be really appreciated. 
Also if i am supposed to use this approach i am unaware of the method of using alternating '%3A' as delimiter .

Not clear how you get your output

@Sotos For each url starting from 'q=' take pair of data delimited by '%3A' the first data is the parameter the second data is the value.

Please have a look at urltools, it might contain what you are trying to achieve.

urltools looks like an awesome package for what you want to do. Here's a hacked answer in the meantime. Starting with your data.frame:
# Convert to character list
# Get rid of url
# Split by "%3A" and convert to "long" list
L <- as.character(mydata$Id)
L <- gsub("https://www.example.com/dp/c/830216013\\?", "", L)
L <- unlist(strsplit(L, "%3A"))

head(L)
[1] "q="                    "relevance"             "brickpattern"         
[4] "Decorative%2FArt+Deco" "brickpattern"          "Floral"

Then:
# Convert to 2-column data frame
# Count unique parameter:value pairs
df <- data.frame(parameter = L[seq(1,length(L),2)], value = L[seq(2,length(L),2)]) %>%
      group_by(parameter, value) %>%
      summarize(frequency=sum(!is.na(value)))

I will show only the following entries where frequency >= 2:
# Show only entries with frequency >= 2
filter(df, frequency >= 2)

            parameter     value frequency
               <fctr>    <fctr>     <int>
1               brand     Celio         2
2         bricksleeve     Short         2
3                  q= relevance         6
4 verticalcolorfamily     Black         2
5 verticalcolorfamily     White         2

Note that brand::FLYING+MACHINE != 2 because FLYING+MACHINE occurs as FLYING%20MACHINE and FLYING+MACHINE.
