Guest User

Untitled

a guest
Oct 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. collection=mongo(collection="mycs", db="mydb")
  2. ans<- collection$find()
  3.  
  4. df<-as.data.frame(ans)
  5.  
  6. extracting<-regmatches(df$text,gregexpr("#(\d|\w)+",df$text))
  7.  
  8. ndf<-as.data.frame(extracting)
  9.  
  10. p = ggplot(ndf, aes(x = ndf, y = freq)) + geom_bar(fill = "blue")
  11. p
  12.  
  13. # data
  14. df <-
  15. structure(list(
  16. created_at = c("Thu Oct 19 10:46:32 +0000 2017",
  17. "Thu Oct 19 10:46:32 +0000 2017",
  18. "Thu Oct 19 10:46:32 +0000 2017"),
  19. id = c(920964376408068096, 920964376408068096, 920964376408068096),
  20. text = c("RT @Nagaa27: Me on Open Science Framework #Cryptography #kriptografi #python #freebook #ComputerScience #OpenScienc…",
  21. "RT @Nagaa27: Me on Open Science Framework #Cryptography #kriptografi #python #freebook #ComputerScience #OpenScienc…",
  22. "RT @Nagaa27: Me on Open Science Framework #Science #OpenScienc…")))
Add Comment
Please, Sign In to add comment