if (interactive()) {
x = sample(10, 100, rep = TRUE)
y = stats::rnorm(100)
z = sample(letters[1:3],100, rep=TRUE)
dat = data.frame(x,y,z)
bar.plot(dat, 'x', 'y')
bar.plot(dat, 'x', 'y', group.var = 'z')
}
Run the code above in your browser using DataLab