Jump to content

Using RSentiment to analyze a text column


Vincent Thuilot

Recommended Posts

Hello,

I would like to use RSentiment package to analyze a text column on a table imported in an analysis.

I'm mostly interested to use basic functions like calculate_total_presence_sentiment or calculate_score for every row.

So far I managed to install the package, but the R commands I put aren't sufficient to make it work in a data function.

Would you have an example of an RSentiment script that I could use in a data function?

Thanks in advance!

Link to comment
Share on other sites

I tried this

library(RSentiment)

text_column<-table1$column1

sentiment_scores<-lapply(column1,calculate_sentiment)

sentiment_df<-do.call(rbind, sentiment_scores)

merged_data<-cbind(table1, sentimentdf$outcome2)

and this

for (row in table1) {

  Output1=calculate_score(c("data1"))

}

but no luck so far, see error attached.

if you have any idea, please go ahead!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...