Running examples in ‘sentimentr-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: sentiment
> ### Title: Polarity Score (Sentiment Analysis)
> ### Aliases: sentiment
> ### Keywords: polarity sentiment,
> 
> ### ** Examples
> 
> mytext <- c(
+    'do you like it?  But I hate really bad dogs',
+    'I am the best friend.',
+    "Do you really like it?  I'm not a fan",
+    "It's like a tree."
+ )
> 
> ## works on a character vector but not the preferred method avoiding the 
> ## repeated cost of doing sentence boundary disambiguation every time 
> ## `sentiment` is run.  For small batches the loss is minimal.
> ## Not run: 
> ##D sentiment(mytext)
> ## End(Not run)
> 
> ## preferred method avoiding paying the cost 
> mytext <- get_sentences(mytext)
> sentiment(mytext)
   element_id sentence_id word_count  sentiment
1:          1           1          4  0.2500000
2:          1           2          6 -1.8677359
3:          2           1          5  0.5813777
4:          3           1          5  0.4024922
5:          3           2          4  0.0000000
6:          4           1          4  0.0000000
> sentiment(mytext, question.weight = 0)
   element_id sentence_id word_count  sentiment
1:          1           1          4  0.0000000
2:          1           2          6 -1.8677359
3:          2           1          5  0.5813777
4:          3           1          5  0.0000000
5:          3           2          4  0.0000000
6:          4           1          4  0.0000000
> 
> sam_dat <- get_sentences(gsub("Sam-I-am", "Sam I am", sam_i_am))
> (sam <- sentiment(sam_dat))
     element_id sentence_id word_count sentiment
  1:          1           1          3 0.0000000
  2:          2           1          3 0.0000000
  3:          3           1         NA 0.0000000
  4:          4           1          4 0.0000000
  5:          5           1          4 0.0000000
 ---                                            
193:        165           2          5 0.2683282
194:        166           1          4 0.2500000
195:        167           1          4 0.0000000
196:        168           1          2 0.3535534
197:        169           1          5 0.2236068
> plot(sam)
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... push.vp.vpTree -> push.vp -> push.vp.viewport -> grid.Call.graphics
Execution halted