| formatCI | R Documentation | 
Format confidence intervals
formatCI(
  x,
  lower,
  upper,
  show.x = FALSE,
  handler = "sprintf",
  format = "[l;u]",
  degenerated = "asis",
  digits = 2,
  nsmall = digits,
  sep = "",
  reference.pos,
  reference.label = "",
  ...
)
| x | not used (for compatibility with format) | 
| lower | Numeric vector of lower limits | 
| upper | Numeric vector of upper limits | 
| show.x | Logical. If  | 
| handler | Function to format numeric values. Default is
 | 
| format | Character string in which  | 
| degenerated | String to show when lower==upper. Default is '–' | 
| digits | If handler  | 
| nsmall | If handler  | 
| sep | Field separator | 
| reference.pos | Position of factor reference | 
| reference.label | Label for factor reference | 
| ... | passed to handler | 
The default format for confidence intervals is [lower; upper].
String vector with confidence intervals
Thomas A. Gerds <tag@biostat.ku.dk>
plot.ci ci.mean
x=ci.mean(rnorm(10))
formatCI(lower=x[3],upper=x[4])
formatCI(lower=c(0.001,-2.8413),upper=c(1,3.0008884))
# change format
formatCI(lower=c(0.001,-2.8413),upper=c(1,3.0008884),format="(l, u)")
# show x
formatCI(x=x$mean,lower=x$lower,upper=x$upper,format="(l, u)",show.x=TRUE)
# change of handler function
l <- c(-0.0890139,0.0084736,144.898333,0.000000001)
u <- c(0.03911392,0.3784706,3338944.8821221,0.00001)
cbind(format=formatCI(lower=l,upper=u,format="[l;u)",digits=2,nsmall=2,handler="format"),
      prettyNum=formatCI(lower=l,upper=u,format="[l;u)",digits=2,nsmall=2,handler="prettyNum"),
      sprintf=formatCI(lower=l,upper=u,format="[l;u)",digits=2,nsmall=2,handler="sprintf"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.