title: how to loopover rows in R to split the column based on respective values in adjacent column?
body: <p>I have data frame with two columns as characters:</p>
  
  <pre><code>col1              col2
  "Chharodi"       "Jasmine Green-1, Chharodi,Ravalvas, Chharodi,Thakorvas, Chharodi"
  "Lapkaman"       "Belavyu Farm, Lapakaman,Ravalvas, Lapakaman,Vankarvas, Lapakaman"
  "Ognaj"          "Vav Valo Vas, Oganaj,Marutinadan Society, Oganaj,Ravalvas,Ognaj"
  </code></pre>
  
  <p>I want to split the col2 with this out put (splitting the text based on adjacent value in col1):</p>
  
  <pre><code>col3                  col4                    col5          col_contd..
  Jasmine Green-1      Ravalvas                Thakorvas
  Belavyu Farm         Ravalvas                Vankarvas
  Vav Valo Vas         Marutinadan Society     Ravalvas
  </code></pre>
  
  <p>get an error of 'non-character argument' when i use this</p>
  
  <pre><code>for (i in 1:nrow(df)){
    df1&lt;-strsplit(df, df$col2[i],split = df$col1[i])
  }
  </code></pre>
  
  <p>Also, how do I bind the rows together to create final df?</p>