[R] Plotting Numeric Values with Non-Numeric Values

William Dunlap wdunlap at tibco.com
Mon Sep 14 22:29:59 CEST 2015


d <- data.frame( # data to make a self-contained example
    gender=rep(c("Female","Male"),c(4,6)),
    bmi=c(seq(24,25,len=4), seq(25,27,len=6)),
    age=c("Young","Old")[c(1,1,2,2,1,1,1,1,2,2)])
boxplot(bmi ~ gender, data=d)
lattice::bwplot(bmi ~ gender, data=d)
lattice::bwplot(bmi ~ gender | age, data=d) # separate panel for each age group
lattice::stripplot(bmi ~ gender, data=d)
lattice::dotplot(bmi ~ gender|age, data=d)

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Sep 14, 2015 at 11:49 AM, mtilley3 <mtilley3 at gatech.edu> wrote:
> I have looked for quite a long time and can't quite find the answer for what
> I'm looking for. I want to graph bmi vs gender, with male/female on the
> x-axis and the bmi numerical value on the y-axis. Can anyone explain how to
> do this? Thanks!
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Plotting-Numeric-Values-with-Non-Numeric-Values-tp4712253.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list