Skip to content

draw categorical histogram

5 messages · phoebe kong, Andrew Miles, Jorge Ivan Velez

#
Try:

plot (myCatVariable)

Andrew Miles
Department of Sociology
Duke University
On Dec 1, 2010, at 2:51 PM, phoebe kong wrote:

            
#
Phoebe,

In addition to the barplot method below, you really can use plot() to  
draw what it sounds like you are looking for IF you have a categorical  
variable.  To illustrate, try running the following code:

x=sample(c("Richard", "Minnie", "Albert", "Helen", "Joe", "Kingston"),  
50, replace=T)
x=as.factor(x)
plot(x)

See also ?plot.factor

Andrew Miles
On Dec 1, 2010, at 4:06 PM, Jorge Ivan Velez wrote: