title: R - error in separating text from a string using regex and ifelse condition
body: <p>What I want to do is to strip text from a string where ever there is an ":".</p>
  
  <p>Suppose my text contains:</p>
  
  <pre><code> text$Text[[3]] = "There is a horror movie running in the iNox theater. : Can we go?"
  </code></pre>
  
  <p>And what I want to create a dataframe such that:</p>
  
  <pre><code>  Col1                                                    Col2
    There is a horror movie running in the iNox theater.    Can we go?
  </code></pre>
  
  <p>I am trying to use the following :</p>
  
  <pre><code> df = data.frame(Text = strsplit(text$Text[[3]], 
                   ifelse(":", ":", text$Text[[3]]))[[1]], stringsAsFactors = F)
  </code></pre>
  
  <p><code>dat3$Text[[3]]</code> because the text is in row no. 3 of the text$Text.</p>
  
  <p>But the above <code>ifelse()</code> logic did not work. Here I was trying to use ifelse condition such that if there is a ":" in the text, use ":" otherwise use the complete text as it is. So it means in case if there is no ":" then the result would look like something:</p>
  
  <pre><code> text$Text[[3]] = "Hi Mom, You there. Can I go to Jimmy's house?"
  
   Col1                                                 Col2
   Hi Mom, You there. Can I go to Jimmy's house?         NA
  </code></pre>
  
  <p>How to do it correctly?</p>
  
  <p>Please note that there is a catch:</p>
  
  <ul>
  <li>What if there are two ":" in the text?? </li>
  <li>I would like to consider only that ":" which is within first two lines and not in the rest of the text? </li>
  </ul>