Re: geom_histogram

251 views
Skip to first unread message
Message has been deleted

Brandon Hurr

unread,
Sep 28, 2012, 4:18:14 AM9/28/12
to Sarita Paranjpe, ggp...@googlegroups.com
For a histogram you only supply an x variable. 

ggplot(z, aes(x=value, fill=variable)) + geom_histogram(position=position_dodge())




On Fri, Sep 28, 2012 at 9:04 AM, Sarita Paranjpe <heys...@gmail.com> wrote:
ggplot(z, aes(x=variable, fill=variable, y=value)) + geom_histogram(position="dodge")

Muhuri, Pradip (SAMHSA/CBHSQ)

unread,
Sep 28, 2012, 5:35:55 PM9/28/12
to Brandon Hurr, Sarita Paranjpe, ggp...@googlegroups.com

Hello,

 

I have applied the code, which you had sent to Sarita, to my data for a smilar plot I am interested in. I got the following error message.

 

“X=agedth” is a continuous variable that has values ranging from 18 to 95. “Fill=percent” has data that correspond to x.

 

Any help will be appreciated.

 

Thanks,

 

Pradip  

 

###########################

library("ggplot2")

> ggplot(tempdata, aes(x=agedth, fill=percent)) + geom_histogram(position=position_dodge())

stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

Error in unit(tic_pos.c, "mm") : 'x' and 'units' must have length > 0

 

 

Pradip K. Muhuri, PhD

Statistician

Substance Abuse & Mental Health Services Administration

The Center for Behavioral Health Statistics and Quality

Division of Population Surveys

1 Choke Cherry Road, Room 2-1071

Rockville, MD 20857

 

Tel: 240-276-1070

Fax: 240-276-1260

e-mail: Pradip...@samhsa.hhs.gov

 

The Center for Behavioral Health Statistics and Quality your feedback.  Please click on the following link to complete a brief customer survey:   http://cbhsqsurvey.samhsa.gov

--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

Reply all
Reply to author
Forward
0 new messages