Last active
August 29, 2015 14:14
-
-
Save nurandi/6bc8748fafc5197265ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Menghitung frequensi per kata | |
text = readLines("pidato-presiden.txt") | |
text = unlist(strsplit(text, "\\W+")) | |
text = tolower(text) | |
text = data.frame(table(text)) | |
# Menghapus stop-words | |
stopw = readLines("stopwords-id.txt") | |
text = text[!is.element(text$text, stopw),] | |
# Generate word-cloud | |
wordcloud(text$text, text$Freq, random.order=FALSE, rot.per=0.25, colors=brewer.pal(8, "Dark2")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment