trinker / sentimentr

Dictionary based sentiment analysis that considers valence shifters
Other
427 stars 84 forks source link

Alternate plot type for < 100 for all sentiment style funs (profantiy, sentiment, emotion) #96

Closed trinker closed 6 years ago

trinker commented 6 years ago
plot(sentiment('I hate this stuff'))
 Show Traceback

 Rerun with Debug
 Error in transformation.function(stats::na.omit(x[["sentiment"]]), ...) : 
  low_pass_size must be less than or equal to the length of raw_values input vector 
trinker commented 6 years ago

Interpolation to the rescue for n < 1000

y <- sample(1:1000, 10)

plot(x = 1:10, y = y)
ap <- approx(x = 1:10, y = y, n=100)
points(ap$x, ap$y, col = 2, pch = "*")