Stacked Bar Chart

I've got a data frame that holds counts that I generated from two random mixes of candies...

> nBoth
        blue brown green orange red yellow
nMMs      29    60    28     20  63     50
nBrandX   28    57     9     43  68     45

...and I want to create a couple of bar charts of the two brands. I get a fine stacked chart when I execute

barplot(nBoth, main = "Candy Distribution", ylab = "Candy Count", col = c("blue", "orange"))

...but when I add the argument

beside=FALSE

to wit:

barplot(nBoth, main = "Candy Distribution", ylab = "Candy Count",  col = c("blue”, “orange"), beside = FALSE)

I get an error:

Error in rect(y1, x1, y2, x2, ...) : invalid color name 'blue”, “orange'

Note that the error message has a single quote after the word orange, but there is a tpical double quote there.

Not really you have " and not the same character

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.