trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

polarity has two polarized words #140

Closed trinker closed 10 years ago

trinker commented 11 years ago

What to do if polarity has two polarize words:

polarity("nor to of hate go on my list of the big dog in the attic that I hate")

Error in `$<-.data.frame`(`*tmp*`, "neg.words", value = c("hate", "hate" : 
  replacement has 2 rows, data has 1

Currently thinking to store as a list instead of a vector, collect the extras and average the scores together.

trinker commented 11 years ago

Same for 2 positives:

polarity("These are good people I love.")

Error in `$<-.data.frame`(`*tmp*`, "pos.words", value = c("good", "love" : 
  replacement has 2 rows, data has 1
trinker commented 11 years ago

I could sum them all or average...

iokat commented 11 years ago

Yes, I've noticed that a few days ago, but I thought that it was due to the fact that I am using the function not the way it was meant to be used (e.g. with data frames, not with single strings).

When you put the same sentence into a data frame (along with others), and you use it with the with() function it will provide with a result (not an error). I am not sure if the result is correct though.

In your DATA example there is such a sentence ("Computer is fun. Not so fun.")