title: splitting a column delimiter R
body: <p>I have a dataframe as below. I want to split the last column into 2. Splitting needs to be done based upon the only first : and rest of the columns dont matter.</p>
  
  <p>In the new dataframe, there will be 4 columns. 3 rd column will be (a,b,d) while 4th column will be (1,2:3,3:4:4)</p>
  
  <p>any suggestions? 4th line of my code doesnt work :(. I am okay with completely new solution or corrections to the line 4</p>
  
  <pre><code>employee &lt;- c('John Doe','Peter Gynn','Jolie Hope')
  salary &lt;- c(3, 2, 1)
  df &lt;- data.frame(employee, salary, originalColumn = c("a :1", "b :2:3", "d: 3:4:4"))
  
  as.data.frame(do.call(rbind, strsplit(df,":")))
  </code></pre>
  
  <p>--------------------update1</p>
  
  <p>Below solutions work well. But i need a modified solution as I just realized that some of the cells in column 3 wont have ":". In such case i want text in that cell to appear in only 1st column after splitting that column</p>
  
  <pre><code>employee &lt;- c('John Doe','Peter Gynn','Jolie Hope')
  salary &lt;- c(3, 2, 1)
  df &lt;- data.frame(employee, salary, originalColumn = c("a :1", "b", "d: 3:4:4"))
  </code></pre>