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

2005-12-07 Thread P Ehlers
As usual, Gabor provides an elegant solution. But I hope that, in this case, the OP provided a toy example. Otherwise, I don't see the point of applying cut() to a vector of length 7. Why not just use stripchart()? Peter Ehlers Gabor Grothendieck wrote: > Or building on that solution but elimina

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

2005-12-07 Thread Gabor Grothendieck
Or building on that solution but eliminating the do.call and lapply: f <- function(x) table(cut(x, breaks = seq(0, 30, 5))) barplot(rbind(f(x), f(y)), beside = TRUE) On 12/7/05, Jacques VESLOT <[EMAIL PROTECTED]> wrote: > try : > > barplot(do.call("rbind",lapply(list(x,y), function(x) table(cut(x

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

2005-12-07 Thread Jacques VESLOT
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) > >

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

2005-12-07 Thread Subhabrata
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)