# [R] Multiple formula in one block

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.ac.be
Mon Oct 25 09:39:18 CEST 2004

```Hi YiYao,

you need the `?panel.abline()' function, somehing like:

panel=function(x, breaks, equal.widths, type, ...){
panel.histogram(x, breaks, equal.widths, type, ...)
panel.abline(v=mean(singer\$height))
}

inside the `histogram()' function could do the trick.

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm

----- Original Message -----
From: "YiYao_Jiang" <YiYao_Jiang at smics.com>
To: <r-help at stat.math.ethz.ch>
Cc: "YiYao_Jiang" <YiYao_Jiang at smics.com>
Sent: Monday, October 25, 2004 9:16 AM
Subject: [R] Multiple formula in one block

> Hi Everybody:
>
> I want to draw some chart using command "histogram" and add another
> curve in it.
> Example:
>
> require(stats)
> data(singer)
> library(lattice)
> histogram( ~ height | voice.part, data = singer, nint = 17,
> endpoints = c(59.5, 76.5), layout = c(2,4), aspect = .5,  xlab =
> "Height (inches)")
>
> Now I got a chart of 8 blocks, then I need add :"
> abline(v=mean(singer\$height), col=2, lwd=2) " or any other curve to
> every block.
> How can I do to achieve it. Thanks.
>
>
> Best Regards
>
> YiYao Jiang
>
> Product Division/ product Testing Department
> Semiconductor Manufacturing International Corporation
> 18 ZhangJiang Road, PuDong New Area, Shanghai  ZIP: 201203
> Tel:86-21-5080-2000 Ext. 15173
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help