[R] Plot grouped histograms

soeren.vogel at eawag.ch soeren.vogel at eawag.ch
Thu Oct 9 21:05:32 CEST 2008

r11 -- r16 are variables showing a reason for usage of a product in 6  
different situations. Each variable is a factor with 4 levels imported  
from a SPSS sav file with labels ranging from "not important" to "very  
important", and NA's for a sample of N = 276.

(1) I need a chi square test of independence showing that the reason  
does not differ depending on the situation.

(2) I need a single coloured histogram plot. The x axis should be  
grouped by the 6 situation with small space between the groups, each  
group should show different bars for each factor value ("not  
important", "little...", ..., "NA's"), but NA's is not necessary.

I've been googling the whole day, searching the mailing list and  
handbooks, and struggled through the somewhat R programmer specific  
documentation. Beeing a newby in R, I'm now afraid that I have to go  
back to SPSS and Excel where my tasks would be a work of an hour. But  
I was told "euphoric" that R may solve many of the problems I have  
(and don't like) with SPSS, or having to separate calculation (SPSS,  
Excel by hand) and plotting (GNUplot).

So my two questions are: How can I easily solve my 2 tasks? Secondly,  
is R really recommended for R newbys in daily work?

Thank you for any help


More information about the R-help mailing list