Skip to content

categorized barplot

3 messages · Rafael Moral, John Kane, Jim Lemon

#
Dear useRs,

I can't seem to find out how to categorize my histogram.

I have the following dataset:

Time??????????? First.day? Second.day
08:00-10:00??????? 9?????????? ? 8
10:00-12:00?????? 13???????? ? 15
12:00-14:00??????? 9?????????? ? 9
14:00-16:00???????10????????? ? 9

I attached a jpeg file to this e-mail containing the sketches.
What I'd like to do is a barplot (or histogram), firstly?with 2 categories - first and second day (figure 1)
And then with 4 categories - the times (figure 2)
Also, I'd like the graphs both with lines (as sketched) and bars.

Thanks in advance,
Kind regards,

Rafael.


      ____________________________________________________________________________________
Veja quais s?o os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
#
I think you want a barplot.  I don't see what a histogram will add.  

Your attachement seems to have been lost so I am just guessing what you might want but, assuming you have a data.frame try

barplot(as.matrix(xx[,2:3]), beside = TRUE)

dd <- t(as.matrix(xx[,2:3]))
colnames(dd) <- xx[,1]
barplot(dd, beside=TRUE)

Have a look at arguments such as density and color in ?barplot for lines etc.
--- On Thu, 8/20/09, Rafael Moral <rafa_moral2004 at yahoo.com.br> wrote:

            
__________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/
#
Rafael Moral wrote:
Hi Rafael,
The hierobarp function in the plotrix package does something like this, 
overlaying successively finer breakdowns. I am currently writing more 
variants of this function and one that displayed a multiway array would 
be quite useful. If you think that a variant of hierobarp would suit 
your needs, let me know.

Jim