title: With or without quotes in dataframes with R
body: <p>I am trying to do a sentiment analysis system using Naive Bayes. In the train data I have a dataframe like this:</p>
  
  <pre><code>[1] "good"       "bad"           "ugly"       "not too bad"       "so bad"       "too bad"       "very good"          
     [8] "good"       "too bad"       "good"       "too bad"       "too bad"           "good"       "too bad"  
  </code></pre>
  
  <p>And in the test data, I have a dataframe like this: </p>
  
  <pre><code>[1] good      too  bad           too  ugly       not too bad       so bad       too bad       very good          
     [8] good       too bad       so good       too bad       too bad           good       too bad  
  </code></pre>
  
  <p>As you can see in the test dataframe I have sentiment words without " ". Will this cause any problems?</p>
  
  <p>EDIT:</p>
  
  <p>Here the R code : </p>
  
  <pre><code>library(tidyverse)
  library(text2vec)
  library(caret)
  library(glmnet)
  library(ggrepel)
  library(Matrix)
  library(tm)
  library(RTextTools)
  library(e1071)
  
  Train_classifier1 &lt;- read.csv('IRC.csv',header=T, sep=";")
  Train_classifier2 &lt;- read.csv('IRC_ag_2014_s2.csv',header=T, sep=";")
  Train_classifier3 &lt;- read.csv('IRC_ag_2015_s1.csv',header=T, sep=";")
  Train_classifier4 &lt;- read.csv('IRC_ag_2015_s2.csv',header=T, sep=";")
  
  Train1 &lt;- Train_classifier1[, c("Note.Reco", "Raison.Reco")]
  Train2 &lt;- Train_classifier2[, c("Note.Reco", "Raison.Reco")]
  Train3 &lt;- Train_classifier3[, c("Note.Reco", "Raison.Reco")]
  Train4 &lt;- Train_classifier4[, c("Note.Reco", "Raison.Reco")]
  
  Train_classifier &lt;- rbind(Train1, Train2, Train3, Train4)
  
  # select only 4 column of the dataframe
  
  #Train &lt;- Train_classifier[, c("Note.Reco", "Raison.Reco")]
  #, "DATE_SAISIE", "idpart")]
  
  #delete rows with empty value columns
  Train &lt;- Train_classifier[rowSums(Train_classifier == '') == 0,]
  Train$ID &lt;- seq.int(nrow(Train))
  
  Train
  
  
  # # replacing class values
  Train$Note.Reco = ifelse(Train$Note.Reco &gt;= 0 &amp; Train$Note.Reco &lt;= 4, "super détracteur", ifelse(Train$Note.Reco &gt;= 5 &amp;
  Train$Note.Reco &lt;= 6, "détracteur", ifelse(Train$Note.Reco &gt;= 7 &amp; Train$Note.Reco &lt;= 8, "neutre", "prometteur")))
  
  p &lt;- as.vector(Train[1:41789,2])
  matrix = create_matrix(p, language = "french", removeStopwords = TRUE, removeNumbers = TRUE, stemWords = FALSE)
  sparse_DTM &lt;- removeSparseTerms(matrix, 0.98)
  mat=as.matrix(sparse_DTM)
  
  classifier = naiveBayes(mat[1:40000,], as.factor(Train[1:40000,1]))
  
  predicted = predict(classifier, mat[40001:41789,]); predicted
  #mat[40001:41789,]
  table(Train[40001:41789,1 ], predicted)
  recall_accuracy(Train[40001:41789,1 ], predicted)
  </code></pre>