I have this static text https://api.xxx.com/resource/xxx?api-key=xxx&format=json&limit=500. I want to concatenate this string with the other string &filters[city]=Mumbai&filters[polutant_id]=PM10. The second string should be added dynamically based on the conditions shown in the list below.
cond=list(city=c("Mumbai,Delhi"), polutant_id=c("PM10,NO2"))
The output below contains 4 string as the above list has 4 possible combination of city and polutant_id.
Output
"https://api.xxx.com/resource/xxx?api-key=xxx&format=json&limit=500&filters[city]=Mumbai&filters[polutant_id]=PM10"
"https://api.xxx.com/resource/xxx?api-key=xxx&format=json&limit=500&filters[city]=Delhi&filters[polutant_id]=PM10"
"https://api.xxx.com/resource/xxx?api-key=xxx&format=json&limit=500&filters[city]=Mumbai&filters[polutant_id]=NO2"
"https://api.xxx.com/resource/xxx?api-key=xxx&format=json&limit=500&filters[city]=Delhi&filters[polutant_id]=NO2"
Note : There can be more or less than two elements in the list