title: Use Multiple for loop to get combinations of all elements
body: <p>I'm trying to use combination for multiple elements in three character vector, but I 'm getting only last element iterations, <strong>also I want to put a condition that my <em>budg_min</em> should not be greater than <em>budg_max</em> while creating a list of combinations</strong></p>
  
  <p>here is my code</p>
  
  <pre><code>    text1="http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom="
      text3="&amp;proptype="
      text4="Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment"
      text5="&amp;cityName=Thane&amp;BudgetMin="
      text6="&amp;BudgetMax="
  
  
      uuu=list()
      bhk=c("1","2","3","4","5","&gt;5")
      budg_min=c("5-Lacs","10-Lacs","20-Lacs","30-Lacs","40-Lacs","50-Lacs","60-Lacs","70-Lacs","80-Lacs","90-Lacs","1-Crores","1.2-Crores","1.4-Crores","1.6-Crores","1.8-Crores","2-Crores","2.3-Crores","2.6-Crores","3-Crores","3.5-Crores","4-Crores","4.5-Crores","5-Crores","10-Crores","20-Crores")
      budg_max=c("5-Lacs","10-Lacs","20-Lacs","30-Lacs","40-Lacs","50-Lacs","60-Lacs","70-Lacs","80-Lacs","90-Lacs","1-Crores","1.2-Crores","1.4-Crores","1.6-Crores","1.8-Crores","2-Crores","2.3-Crores","2.6-Crores","3-Crores","3.5-Crores","4-Crores","4.5-Crores","5-Crores","10-Crores","20-Crores")
  
      for(i in bhk){
        for(j in budg_min){
          for(k in budg_max) {
        if(budg_min&gt;budg_max){"Skip that combination "}
  else{
  
  
       uuu[i]=paste(text1,i,text3,text4,text5,j,text6,k,sep = "")
           }
       }
      }
      }
  </code></pre>
  
  <p>I'm expecting output like</p>
  
  <pre><code>[1]
  http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=1&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMax=5-Lacs
  [2]
  http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=1&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=5-Lacs&amp;BudgetMax=10-Lacs
  [3]
  http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=1&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=5-Lacs&amp;BudgetMax=20-Lacs
  .
  .
  .
  .
  [n]
  http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=%3E5&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMax=20-Crores
  </code></pre>
  
  <blockquote>
    <p><strong>note</strong>:in the output above 1st element of list contains only <strong>BudgetMax</strong>
    parameter AND last(nth) element of list has only <strong>BudgetMax</strong> parameter
    and rest elements are the combination of  bhk , budg_min and budg_min.</p>
  </blockquote>
  
  <p>But what my code gives is just 6 records</p>
  
  <pre><code>[1] "http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=1&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=20-Crores&amp;BudgetMax=20-Crores"
  
  $`2`
  [1] "http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=2&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=20-Crores&amp;BudgetMax=20-Crores"
  
  $`3`
  [1] "http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=3&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=20-Crores&amp;BudgetMax=20-Crores"
  
  $`4`
  [1] "http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=4&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=20-Crores&amp;BudgetMax=20-Crores"
  
  $`5`
  [1] "http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=5&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=20-Crores&amp;BudgetMax=20-Crores"
  
  $`&gt;5`
  [1] "http://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=&gt;5&amp;proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment&amp;cityName=Thane&amp;BudgetMin=20-Crores&amp;BudgetMax=20-Crores"
  </code></pre>
  
  <p>What changes should be made to my code so that it gives my all combinations.
  Any help would be much appreciated.Thanks</p>