title: Conversion of text in column to a dataframe
body: <p>I have text data in the column of a data set as follow </p>
  
  <pre><code>UNIQUEID Cloumn1
  1        FG
  2        PR FG RT
  3        FG BR UP DR ST
  ....
  </code></pre>
  
  <p>I want to convert the column of data into a data frame  so that the output is as under and these texts (FG, RN, etc) become variables</p>
  
  <pre><code>UNIQUEID   FG  PR RT BR UP DR ST
  1           1  0  0  0  0  0  0
  2           1  1  1  0  0  0  0
  3           1  0  0  1  1  1  1
  ......
  </code></pre>
  
  <p>I have tried TM package to convert as under</p>
  
  <pre><code>corpus = Corpus(VectorSource(weather$codesum))
  corpus = tm_map(corpus, tolower)
  corpus = tm_map(corpus, removePunctuation)
  corpus = tm_map(corpus, removeWords, stopwords("english"))
  corpus = tm_map(corpus, PlainTextDocument)
  dtm =  DocumentTermMatrix(corpus)
  dtm = as.data.frame(as.matrix(dtm))
  colnames(dtm) = make.names(colnames(dtm))
  str(dtm)
  
  data.frame:   20517 obs. of  1 variable:
   $ prfg: num  0 0 0 0 0 0 0 0 0 0 ...
  </code></pre>
  
  <p>when I see the output I find only one variable. Where as I want all the text as variables.</p>
  
  <p>Please suggest solution </p>