Why do we get "Don't know how to add o to a plot" Error?
<p>Trying to implement the twitter sentiment analysis.
Everything worked fine, but when I try to make Barplots of tweets and getting the error as </p>

<pre><code>    Error: Don't know how to add o to a plot
</code></pre>

<p>When i tried the first time it given me the proper output.
But after that it is giving me the above error</p>

<p>I would like to know why do we get the above error.
In my case I am getting this error in below cases.</p>

<pre><code># add variables to data frame
scores$drink = factor(rep(c("wine", "beer", "coffee", "soda"), nd))
scores$very.pos = as.numeric(scores$score &gt;= 2)
scores$very.neg = as.numeric(scores$score &lt;= -2)

# how many very positives and very negatives
numpos = sum(scores$very.pos)
numneg = sum(scores$very.neg)

# global score
global_score = round( 100 * numpos / (numpos + numneg) )

# colors
cols = c("#7CAE00", "#00BFC4", "#F8766D", "#C77CFF")
names(cols) = c("beer", "coffee", "soda", "wine")

1)  # barplot of average score
meanscore = tapply(scores$score, scores$drink, mean)
df = data.frame(drink=names(meanscore), meanscore=meanscore)
df$drinks &lt;- reorder(df$drink, df$meanscore)

ggplot(df, aes(y=meanscore)) +
geom_bar(data=df, aes(x=drinks, fill=drinks)) +
scale_fill_manual(values=cols[order(df$meanscore)]) +
opts(title = "Average Sentiment Score",
    legend.position = "none")
2)  # barplot of average very positive
drink_pos = ddply(scores, .(drink), summarise, mean_pos=mean(very.pos))
drink_pos$drinks &lt;- reorder(drink_pos$drink, drink_pos$mean_pos)

ggplot(drink_pos, aes(y=mean_pos)) +
geom_bar(data=drink_pos, aes(x=drinks, fill=drinks)) +
scale_fill_manual(values=cols[order(drink_pos$mean_pos)]) +
options(title = "Average Very Positive Sentiment Score",
    legend.position = "none")

3) # barplot of average very negative
drink_neg = ddply(scores, .(drink), summarise, mean_neg=mean(very.neg))
drink_neg$drinks &lt;- reorder(drink_neg$drink, drink_neg$mean_neg)

ggplot(drink_neg, aes(y=mean_neg)) +
geom_bar(data=drink_neg, aes(x=drinks, fill=drinks)) +
scale_fill_manual(values=cols[order(drink_neg$mean_neg)]) +
options(title = "Average Very Negative Sentiment Score",
legend.position = "none")
</code></pre>

<p>Above in all the three cases I am getting the same issue.
please suggest me why I am getting this error.
How can I solve it.</p>

<p>Please suggest me.</p>

<p>Thanks in advance,</p>

<p>Mohan.V</p>