[R] histogram help

Jim Lemon jim at bitwrit.com.au
Thu Nov 22 11:32:33 CET 2012


On 11/22/2012 05:15 AM, Rosario Scandurra wrote:
> Hi,
>
> I want to generate an histogram and plot on the y axis the percentage of a
> categorical variable and on the x axis a nominal variable. I want to move
> the origin to have 2 categories below 0. Hope somebody could help me.
> Thanks.
>
Hi Rosario,
If you already have your percentages, the barplot function will display 
them like most people expect an histogram to look by setting space=0. 
See the "names.arg" argument to have the names of your nominal variables 
on the x axis. I'm not sure exactly what you mean by wanting 2 
categories below 0. If these are negative percentages, the barplot 
function will automatically handle them.

Jim




More information about the R-help mailing list