title: Need help processing multiple response strings from a google form using R
body: <p>I'm trying to process results from a Google Form in R and have hit a wall in dealing with string data. </p>
  
  <p>The question can be seen here: </p>
  
  <p><img src="https://i.stack.imgur.com/sJfOJ.png" alt="enter image description here"></p>
  
  <p>Google returns the results in a single column with a comma separating each response. </p>
  
  <p>They end up looking like</p>
  
  <pre><code>ID | Type of Research
  =====================
  1  | Policy analysis, Review of other research
  2  | Bla
  3  | Review of other research, Original empirical research
  4  | Policy analysis, Theoretical 
  5  | Review of other research
  </code></pre>
  
  <p>I've used grepl to create logical columns and a data.frame for the three pre-selected responses.</p>
  
  <pre><code>Private$ResearchTypeOriginal &lt;- grepl("Original", Private$ResearchType)
  Private$ResearchTypeReview &lt;- grepl("Review", Private$ResearchType)
  Private$ResearchTypePolicy &lt;- grepl("Policy", Private$ResearchType)
  
  ResearchTypeGrid &lt;- data.frame(Private$ResearchTypeOriginal, Private$ResearchTypeReview, Private$ResearchTypePolicy)
  </code></pre>
  
  <p>This works great. However, I also need to pull out the "other"s. I was using </p>
  
  <pre><code>ResearchTypeOther &lt;- subset(Private, !grepl("Original", Private$ResearchType) &amp; !grepl("Review", Private$ResearchType) &amp; !grepl("Policy", Private$ResearchType), select=c(ID, ResearchType, PubLang, Reviewer))
  ResearchTypeOther &lt;- na.omit(ResearchTypeOther)
  </code></pre>
  
  <p>but just realized that if a response has both a pre-selected response AND a open-ended one, that's lost using this method. It works fine for giving me the "Bla" responses, but only the ones that are exclusively "other."</p>
  
  <p>In other words, this produces</p>
  
  <pre><code>ID |  Type of Research
  =======================
  2  |  Bla 
  </code></pre>
  
  <p>But what I'd like is </p>
  
  <pre><code>ID |  Type of Research
  ======================
  2  |  Bla
  4  |  Policy analysis, Theoretical
  </code></pre>
  
  <p>This is my first time posting on SO, and I'm obviously new at R, so please excuse any mistakes in how I'm asking the question. I'm sorry if I'm not phrasing this very well. I have ~20 other questions with the same problem, so I need a flexible solution.</p>
  
  <p>Thanks for any help.</p>