tm.plugin.sentiment calculates the sentiment from (tm text corpora based on simple word counts. The package already includes a sentiment dictionary from the General Inquirer which can be replaced by custom ones. Build up of sentiment time series in xts and charting using facilities of quantmod are also supported.
Using the devtools package you can easily install the latest development version of tm.plugin.sentiment from github with
The following lines show the basic functionality calculating the sentiment for the Apple (AAPL) stock:
library(tm.plugin.sentiment) # retrieve corpus require(tm.plugin.webmining) corp = WebCorpus(GoogleFinanceSource("AAPL")) # score corpus corp <- score(corp) sentixts <- metaXTS(corp) # chart sentiment scores chartSentiment(sentixts)
tm.plugin.sentiment is released under the GNU General Public License Version 3