“polarity” function in R – Error in derive_pubkey(key)

Below is an error message that came up while using “polarity” function of “qdap” package for Sentiment Analysis in R.

Error message:

Error in derive_pubkey(key) : RAW() can only be applied to a ‘raw’, not a ‘list’


This error has something to do with a clash across different packages or stuff that is loaded in the workspace.

R line of code that gave error is

>  sentiments = polarity(dataframe.name$column.name)


I am not sure of the exact issue and fix. But, try below suggestions. Some or all of these tips used in combination should fix your error 🙂

  • Clear workspace or start a new session
  • If “twitteR” and “qdap” are both installed,
    1. Detach & remove “twitteR”
    2. Detach & remove “qdap” as well and reinstall (if “a” alone doesn’t work)
  • Ensure the dependencies “qdapDictionaries”, “qdapRegex” & “qdapTools” are correctly installed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s