[R] Barplot - Can't figure it out

T Petersen Terji78 at yahoo.com
Fri Feb 18 06:34:55 CET 2005


Ups, it should of course be barplot() in my mail, not boxplot:-)

Kevin Wang wrote:

> Hi,
>
> T Petersen wrote:
>
>> Hi,
>>
>> I have two catagorical vectors like this;
>>
>> x = c(1, 2, 4, 2, 1)
>> y = c(2, 4, 2 ,4, 1)
>>
>> I want to set up a barplot with the catagories 1-4 horizontally  and 
>> number of occurances vertically for each vector x,y. I've tried
>>
>> boxplot(table(x,y), beside=T)
>>
>> and
>>
>> boxplot(c(x,y), beside=T)
>
>
> Have you tried barplot(), instead of boxplot()???
>
> Cheers,
>
> Kev
>




More information about the R-help mailing list