Advertisement
Guest User

Untitled

a guest
May 27th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.36 KB | None | 0 0
  1. ```{r}
  2. posTweets = 0
  3. negTweets = 0
  4.  
  5.  
  6. for (i in 1:147)
  7.   if (prop.word.length(tweet.corpus[[i]]) == TRUE)
  8.     posTweets = posTweets + 1
  9.  
  10. for(i in 148:438)
  11.   if (prop.word.length(tweet.corpus[[i]]) == TRUE)
  12.     negTweets = negTweets + 1
  13.  
  14. posTweets = posTweets / 147
  15. negTweets = negTweets / 290
  16.  
  17. phat = negTweets/(posTweets + negTweets)
  18.  
  19. phat
  20. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement