Zoppoli, Gabriele (NIH/NCI) [G]
2010-Jan-29 22:29 UTC
[R] help on drawing right colors within a grouped xyplot (Lattice)
Hi, I've lost my mind on it... I have to scatterplot two vectors, grouped by a third variable, with two different dimensions according to whether each cell line in the plot is sensitive or resistant to a given drug, and with a different color for each of 9 tissues of origin. Here's what I've done:>obj<-xyplot(EGFR~EPHA2,data=Dataset,groups=interaction(Sens,Tissue),cex=c(1,3),pch=19) > update(obj, par.settings + custom.theme(symbol = brewer.pal(9, "Paired"),+ fill = brewer.pal(9, "Paired")))>Here are the data: Tissue Sens EGFR ITGB1 1 Breast 1 8.389 12.867 2 Breast 1 3.441 9.636 3 Breast 3 8.286 12.732 4 Breast 3 9.059 12.296 5 Breast 3 7.076 10.519 6 CNS 1 8.068 12.189 7 CNS 1 7.909 11.255 8 CNS 1 7.311 10.259 9 CNS 3 8.337 11.360 10 CNS 3 7.691 12.108 11 CNS 3 7.149 12.104 12 Colon 1 6.656 10.811 13 Colon 1 8.150 10.966 14 Colon 1 7.329 11.309 15 Colon 1 2.512 10.493 16 Colon 3 6.797 9.829 17 Colon 3 8.657 11.766 18 Leukemia 1 2.603 9.421 19 Leukemia 1 2.353 9.283 20 Leukemia 1 2.360 9.413 21 Leukemia 1 2.322 7.200 22 Leukemia 1 2.330 7.880 23 Lung 1 6.607 12.805 24 Lung 1 6.945 11.144 25 Lung 3 8.055 12.421 26 Lung 3 9.407 12.531 27 Lung 3 8.781 12.473 28 Lung 3 10.076 11.881 29 Lung 3 4.073 11.569 30 Melanoma 1 5.829 11.183 31 Melanoma 1 2.533 10.812 32 Melanoma 1 3.253 11.278 33 Melanoma 1 2.427 10.954 34 Melanoma 1 2.522 10.585 35 Melanoma 1 6.019 9.384 36 Melanoma 1 2.711 9.801 37 Melanoma 1 6.570 10.049 38 Melanoma 3 7.838 11.364 39 Ovarian 1 9.067 11.060 40 Ovarian 1 8.645 11.849 41 Ovarian 3 7.079 10.937 42 Ovarian 3 9.626 11.911 43 Ovarian 3 8.478 10.954 44 Ovarian 3 8.890 12.076 45 Prostate 3 8.356 12.486 46 Prostate 3 9.074 11.841 47 Renal 3 9.117 12.324 48 Renal 3 9.522 12.362 49 Renal 3 9.487 12.030 50 Renal 3 8.322 12.798 51 Renal 3 9.359 12.714 52 Renal 3 11.611 13.344 53 Renal 3 9.663 12.004 54 Renal 3 9.819 13.214 Please help me!!!! Thank you so much Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest Researcher, LMP, NCI, NIH, Bethesda MD Work: 301-451-8575 Mobile: 301-204-5642 Email: zoppolig at mail.nih.gov
Deepayan Sarkar
2010-Jan-30 08:20 UTC
[R] help on drawing right colors within a grouped xyplot (Lattice)
On Fri, Jan 29, 2010 at 2:29 PM, Zoppoli, Gabriele (NIH/NCI) [G] <zoppolig at mail.nih.gov> wrote:> Hi, > > I've lost my mind on it... I have to scatterplot two vectors, grouped by a third variable, with two different dimensions according to whether each cell line in the plot is sensitive or resistant to a given drug, and with a different color for each of 9 tissues of origin. > > > Here's what I've done: > >>obj<-xyplot(EGFR~EPHA2,data=Dataset,groups=interaction(Sens,Tissue),cex=c(1,3),pch=19) >> ? ? ? ?update(obj, par.settings > + ? ? ? ?custom.theme(symbol = brewer.pal(9, "Paired"), > + ? ? ? ?fill = brewer.pal(9, "Paired")))So your 'groups' will have 18 levels, and you want each successive pair of levels to have the same color. Instead of 'brewer.pal(9, "Paired")', use rep(brewer.pal(9, "Paired"), each = 2). -Deepayan>> > > Here are the data: > > ?Tissue Sens ? EGFR ?ITGB1 > 1 ? ?Breast ? ?1 ?8.389 12.867 > 2 ? ?Breast ? ?1 ?3.441 ?9.636 > 3 ? ?Breast ? ?3 ?8.286 12.732 > 4 ? ?Breast ? ?3 ?9.059 12.296 > 5 ? ?Breast ? ?3 ?7.076 10.519 > 6 ? ? ? CNS ? ?1 ?8.068 12.189 > 7 ? ? ? CNS ? ?1 ?7.909 11.255 > 8 ? ? ? CNS ? ?1 ?7.311 10.259 > 9 ? ? ? CNS ? ?3 ?8.337 11.360 > 10 ? ? ?CNS ? ?3 ?7.691 12.108 > 11 ? ? ?CNS ? ?3 ?7.149 12.104 > 12 ? ?Colon ? ?1 ?6.656 10.811 > 13 ? ?Colon ? ?1 ?8.150 10.966 > 14 ? ?Colon ? ?1 ?7.329 11.309 > 15 ? ?Colon ? ?1 ?2.512 10.493 > 16 ? ?Colon ? ?3 ?6.797 ?9.829 > 17 ? ?Colon ? ?3 ?8.657 11.766 > 18 Leukemia ? ?1 ?2.603 ?9.421 > 19 Leukemia ? ?1 ?2.353 ?9.283 > 20 Leukemia ? ?1 ?2.360 ?9.413 > 21 Leukemia ? ?1 ?2.322 ?7.200 > 22 Leukemia ? ?1 ?2.330 ?7.880 > 23 ? ? Lung ? ?1 ?6.607 12.805 > 24 ? ? Lung ? ?1 ?6.945 11.144 > 25 ? ? Lung ? ?3 ?8.055 12.421 > 26 ? ? Lung ? ?3 ?9.407 12.531 > 27 ? ? Lung ? ?3 ?8.781 12.473 > 28 ? ? Lung ? ?3 10.076 11.881 > 29 ? ? Lung ? ?3 ?4.073 11.569 > 30 Melanoma ? ?1 ?5.829 11.183 > 31 Melanoma ? ?1 ?2.533 10.812 > 32 Melanoma ? ?1 ?3.253 11.278 > 33 Melanoma ? ?1 ?2.427 10.954 > 34 Melanoma ? ?1 ?2.522 10.585 > 35 Melanoma ? ?1 ?6.019 ?9.384 > 36 Melanoma ? ?1 ?2.711 ?9.801 > 37 Melanoma ? ?1 ?6.570 10.049 > 38 Melanoma ? ?3 ?7.838 11.364 > 39 ?Ovarian ? ?1 ?9.067 11.060 > 40 ?Ovarian ? ?1 ?8.645 11.849 > 41 ?Ovarian ? ?3 ?7.079 10.937 > 42 ?Ovarian ? ?3 ?9.626 11.911 > 43 ?Ovarian ? ?3 ?8.478 10.954 > 44 ?Ovarian ? ?3 ?8.890 12.076 > 45 Prostate ? ?3 ?8.356 12.486 > 46 Prostate ? ?3 ?9.074 11.841 > 47 ? ?Renal ? ?3 ?9.117 12.324 > 48 ? ?Renal ? ?3 ?9.522 12.362 > 49 ? ?Renal ? ?3 ?9.487 12.030 > 50 ? ?Renal ? ?3 ?8.322 12.798 > 51 ? ?Renal ? ?3 ?9.359 12.714 > 52 ? ?Renal ? ?3 11.611 13.344 > 53 ? ?Renal ? ?3 ?9.663 12.004 > 54 ? ?Renal ? ?3 ?9.819 13.214 > > > Please help me!!!! > > Thank you so much > > > > Gabriele Zoppoli, MD > Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy > Guest Researcher, LMP, NCI, NIH, Bethesda MD > > Work: 301-451-8575 > Mobile: 301-204-5642 > Email: zoppolig at mail.nih.gov > ______________________________________________ > 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. >