I'm trying to see the source of the analyzeSentiment()
function for the SentimentAnalysis
package.
First I use :::
:
> SentimentAnalysis:::analyzeSentiment
function (x, language = "english", aggregate = NULL, rules =
defaultSentimentRules(),
removeStopwords = TRUE, stemming = TRUE, ...)
{
UseMethod("analyzeSentiment", x)
}
Using methods()
I see that the function behaves according to the class of the input
> methods(analyzeSentiment)
[1] analyzeSentiment.character* analyzeSentiment.Corpus*
[3] analyzeSentiment.data.frame* analyzeSentiment.DocumentTermMatrix*
[5] analyzeSentiment.TermDocumentMatrix*
When I try to look into these functions using :::
they all rely on a function called analyzeSentiment
.
> SentimentAnalysis:::analyzeSentiment.TermDocumentMatrix
function (x, language = "english", aggregate = NULL, rules =
defaultSentimentRules(),
removeStopwords = TRUE, stemming = TRUE, ...)
{
analyzeSentiment(t(x), language, aggregate, rules, removeStopwords,
stemming, ...)
}
This is the very function I started out by looking into and which got me here. I'm curious as to how it's written. Please help me out of this vicious circle!