title: Convert factors into multiple columns in R
body: <p>I have a dataset with PatientID and their Disease test results and they are as follows :</p>
  
  <pre><code>Id  Result
  1   Strep A: Positive
  2   Flu A: Negative, Flu B: Negative
  3   Rsv: Positive, RsvA: Negative, RsvB: Positive
  4   Strep A: Negative
  5   Flu A: Negative, Flu B: Negative
  6   Flu A: Negative, Flu B: Negative
  7   Strep A: Positive
  </code></pre>
  
  <p>How can I split the <code>Result</code> column as follows :</p>
  
  <pre><code>Id  Result_Strep A  Result_Flu A    Result_Flu B    Result_Rsv  Result_RsvA Result_RsvB
  1   Positive        NA              NA              NA          NA          NA
  2   NA              Negative        Negative        NA          NA          NA
  3   NA              NA              NA              Positive    Negative    Positive
  4   Negative        NA              NA              NA          NA          NA
  5   NA              Negative        Negative        NA          NA          NA
  6   NA              Negative        Negative        NA          NA          NA
  7   Positive        NA              NA              NA          NA          NA
  
  </code></pre>
  
  <p>dput of data</p>
  
  <pre><code>structure(list(Id = 1:7, Result = c("Strep A: Positive", "Flu A: Negative, Flu B: Negative", 
  "Rsv: Positive, RsvA: Negative, RsvB: Positive", "Strep A: Negative", 
  "Flu A: Negative, Flu B: Negative", "Flu A: Negative, Flu B: Negative", 
  "Strep A: Positive")), row.names = c(NA, -7L), class = "data.frame")
  </code></pre>