wordcount {handyplots} | R Documentation |
Word Count
Description
The function takes a text file or text string and outputs a barplot
of the most frequently occuring words.
Usage
wordcount(file = "", n, decreasing = TRUE, text)
Arguments
file |
A text file whose location is interpreted relative to the current working directory (given by |
n |
The number of words to show in the |
decreasing |
If |
text |
If you wish to enter text as an inline argument rather than as a file on your computer, you can enter your text as this argument and leave |
Author(s)
Jonathan Schwartz
See Also
Examples
myfile <- file.path(tempdir(), "wordcounttest.txt")
write("Four four four four. Three three three. Two two. One.",file=myfile )
wordcount(myfile ,4)
##or text can be entered inline
wordcount(text="Four four four four. Three three three. Two two. One.",n=4)