hello, all.
i am trying something new and am stuck. i typically go with whatever colors
the pie function pops out, but i would like to customize it.
please find below a sample dataset.
##TVs per household.
TVs <- factor(c(rep("0", 1), rep("1", 16), rep("2", 14), rep("3", 12), rep("4",
3), rep("5", 2), rep("6", 2)))
##this runs just fine.
pie(table(TVs))
##however, when i add:
colors <- c("cyan3","magenta","darkblue","darkmagenta","darkred",
"darkgoldenrod1", "deeppink")
##and then:
pie(table(TVs, col=colors))
i receive this error.
Error in table(TVs, col = colors) :
all arguments must have the same length
i have tried it a few different ways (changing color names, adding cex
arguments, etc), with same results.
i am not sure why i would be getting this message if it works without the color
functionality. i did a quick search which yielded nothing of value.
thanks in advance.
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.