[R] problem with geom_point in ggplot using a different column

John Kane jrkrideau at inbox.com
Thu Apr 25 19:23:33 CEST 2013


https://github.com/hadley/devtools/wiki/Reproducibility

John Kane
Kingston ON Canada


> -----Original Message-----
> From: angerusso1980 at gmail.com
> Sent: Thu, 25 Apr 2013 11:09:18 -0400
> To: r-help at r-project.org, r-help-request at r-project.org
> Subject: [R] problem with geom_point in ggplot using a different column
> 
> I want to draw boxplot where the geom_points are displayed based on
> "ERBB2.MUT" subset and they should be displayed in the right box (based
> both on the "ERBB2.2064" field and "ERBB2_Status").
> 
> However, given my command I currently only see "red" points corresponding
> to "MUT" subset in one straight line corresponding to only "ERBB2.2064"
> stratification on x-axis. It dosen't take into account the "ERBB2.Status"
> stratification. Can anyone help me?

Is this supposed to represent your data?

> Call ERBB2|2064 ERBB2_Status ERBB2-MUT
> A 7.214E-01 CHANGE MUT
> B -4.208E-02 NEUTRAL MUT
> D 1.080E+00 NEUTRAL MUT
> C 2.347E-01 NEUTRAL MUT
> 
> ggplot(data=testdata, aes(x=Call, y=ERBB2.2064)) +
> geom_boxplot(aes(fill=ERBB2_Status),width=0.8)+theme_bw()+geom_point(data=subset(testdata,ERBB2.MUT=="MUT"),aes(shape=Call,color="Red"))
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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.

____________________________________________________________
Send any screenshot to your friends in seconds...
Works in all emails, instant messengers, blogs, forums and social networks.
TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if2 for FREE



More information about the R-help mailing list