Re: [R] ploting the two sets of data side by side

From: Jacques VESLOT <jacques.veslot_at_cirad.fr>
Date: Wed 07 Dec 2005 - 19:18:24 EST

try :

barplot(do.call("rbind",lapply(list(x,y), function(x) table(cut(x, breaks =c(0,5,10,20,25,30))))),beside=T)

Subhabrata a écrit :

>Hello R-users,
>
>I am new to R-commands.
>
>
>I have two sets of data:
>
>x <- c(7, 7 , 8, 9, 15, 17, 18)
>y <- c(7, 8, 9, 15, 17, 19, 20, 20, 25, 23, 22)
>
>
>I have used 'cut' command to seperate them as follows
>
>a <- cut(x, breaks =c(0,5,10,20,25,30))
>
>b <- cut(y, breaks =c(0,5,10,20,25,30))
>
>
>
>>table(a)
>>
>>
>a
> (0,5] (5,10] (10,20] (20,25] (25,30]
> 0 4 3 0 0
>
>
>>table(b)
>>
>>
>b
> (0,5] (5,10] (10,20] (20,25] (25,30]
> 0 3 5 3 0
>
>
>Now if I want to a single graph with both sets of data side by side for same range.
>
>Can some one help me regarding the above problem.
>
>With Regards
>Subhabrata Pal
>subhabratapal@sraindia.com
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Dec 07 19:26:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:30 EST