title: Twitter Sentimental Analysis with twitteR, all scores are zero?
body: <p>I'm new to Twitter Sentimental Analysis with twitteR, and used the positive.txt and negative.txt from Hu and Liu. I was so glad that everything ran smoothly but the scores for over 1000 tweets all turned out to be neutral (score = 0)? I can't figure out what went wrong, any help is greatly appreciated!</p>
  
  <pre><code>    setup_twitter_oauth(consumer_key, consumer_secret, token, token_secret)
  
      #Get tweets about "House of Cards", due to the limitation, we'll set n=1500
      netflix.tweets&lt;- searchTwitter("#HouseofCards",n=1500)
      tweet=netflix.tweets[[1]]
      tweet$getScreenName()
      tweet$getText()
      netflix.text=laply(netflix.tweets,function(t)t$getText())
      head(netflix.text) 
      write(netflix.text, "HouseofCards_Tweets.txt", ncolumns = 1)
  
      #loaded the positive and negative.txt from Hu and Liu
      positive &lt;- scan("/users/xxx/desktop/positive_words.txt", what = character(), comment.char = ";")
      negative &lt;- scan("/users/xxx/desktop/negative_words.txt", what = character(), comment.char = ";")
  
      #add positive words 
      pos.words =c(positive,"miss","Congratulations","approve","watching","enlightening","killing","solid")
  
      scoredsentiment &lt;- function(hoc.vec, pos.word, neagtive)
      {
          clean &lt;- gsub("(RT|via)((?:\\b\\W*@\\w+)+)", "",hoc.vec)
          clean &lt;- gsub("^\\s+|\\s+$", "", clean) 
          clean &lt;- gsub("[[:punct:]]", "", clean)
          clean &lt;- gsub("[^[:graph:]]", "", clean)
          clean &lt;- gsub("[[:cntrl:]]", "", clean)
          clean &lt;- gsub("@\\w+", "", clean)
          clean &lt;- gsub("\\d+", "", clean) 
          clean &lt;- tolower(clean)
  
          hoc.list &lt;- strsplit(clean, "") 
          hoc=unlist(hoc.list)
  
          pos.matches = match(hoc, pos.words)
          scoredpositive &lt;- sapply(hoc.list, function(x) sum(!is.na(match(pos.matches, positive))))  
          scorednegative &lt;- sapply(hoc.list, function(x) sum(!is.na(match(x, negative))))
          hoc.df &lt;- data.frame(score = scoredpositive - scorednegative, message = hoc.vec, stringsAsFactors = F)
          return (hoc.df)
      }
  
      twitter_scores &lt;- scoredsentiment(netflix.text, scoredpositive, scorednegative)
      print(twitter_scores)
      write.csv(twitter_scores, file=paste('twitter_scores.csv'), row.names=TRUE)
  
      #draw a graph to show the final outcome
      hist(twitter_scores$score)
      qplot(twitter_scores$score)
  </code></pre>
  
  <p>Everything works, but the score for each tweet is the same (score =0)</p>