On 20 February 2010 11:22, Sam Albers <tonightstheni...@gmail.com> wrote:

> #I've tried to alter the panel function according to the thread to produce
> vertical error bars in my barcharts
>
> prepanel.ci <- function(x, y, ly, uy, subscripts, ...) {
>
>        y <- as.numeric(y)
>        ly <- as.numeric(ly[subscripts])
>         uy <- as.numeric(uy[subscripts])
>         list(ylim = range(y, uy, ly, finite = TRUE))
>     }
>
> panel.ci <- function(x, y, lx, ux, subscripts, pch = 16, ...) {
>         x <- as.numeric(x)
>         y <- as.numeric(y)
>         lx <- as.numeric(lx[subscripts])
>         ux <- as.numeric(ux[subscripts])
>
>         panel.arrows(x, ly, x, uy, col = 'black',
>                  length = 0.25, unit = "native",
>                  angle = 90, code = 3)
>         panel.barchart(x, y, pch = pch, ...)
>     }
>



> # Deepayan's original example. I am unsure how to diagnose the packet error.
> This is where I run into problems


Well, when the error message says "argument 'lx' is missing, with no
default", it really means that argument 'lx' is missing, with no
default. Your panel function has an argument 'lx', which you forgot to
change to 'ly' as you did with the prepanel function.

Hope that helps...


> with(err.ucl, barchart(mean ~ err.date | section, group=depth,
>         layout=c(1,3),
>         horizontal=FALSE,
>         scales=list(x=list(rot=45)),
>         ly=lower.se,
>         uy=upper.se,
>         prepanel=prepanel.ci,
>         panel=panel.superpose,
>         panel.groups=panel.ci
>         ))
>



-- 
Felix Andrews / 安福立
Postdoctoral Fellow
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andr...@anu.edu.au
CRICOS Provider No. 00120C
-- 
http://www.neurofractal.org/felix/

______________________________________________
R-help@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.

Reply via email to