[R-gregmisc-users] SF.net SVN: r-gregmisc:[1318] trunk/gplots
Brought to you by:
warnes
|
From: <wa...@us...> - 2009-05-08 21:57:03
|
Revision: 1318
http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1318&view=rev
Author: warnes
Date: 2009-05-08 21:56:38 +0000 (Fri, 08 May 2009)
Log Message:
-----------
plotCI now properly handles 'NULL' and 'NA' values for ui, li, uiw, and liw.
Modified Paths:
--------------
trunk/gplots/R/plotCI.R
trunk/gplots/man/plotCI.Rd
Modified: trunk/gplots/R/plotCI.R
===================================================================
--- trunk/gplots/R/plotCI.R 2009-05-08 21:55:05 UTC (rev 1317)
+++ trunk/gplots/R/plotCI.R 2009-05-08 21:56:38 UTC (rev 1318)
@@ -67,6 +67,12 @@
else
z <- x
+ if(invalid(uiw))
+ uiw <- NA
+ if(invalid(liw))
+ liw <- NA
+
+
if(invalid(ui))
ui <- z + uiw
if(invalid(li))
Modified: trunk/gplots/man/plotCI.Rd
===================================================================
--- trunk/gplots/man/plotCI.Rd 2009-05-08 21:55:05 UTC (rev 1317)
+++ trunk/gplots/man/plotCI.Rd 2009-05-08 21:56:38 UTC (rev 1318)
@@ -41,18 +41,18 @@
defaults to \code{1:n}.}
\item{uiw}{ width of the upper or right error bar. Set to \code{NULL}
- omit upper bars.}
+ or \code{NA} to omit upper bars.}
\item{liw}{ width of the lower or left error bar. Defaults to same value as
- \code{uiw}. Set to \code{NULL} to omit lower bars. }
+ \code{uiw}. Set to \code{NULL} or \code{NA} to omit lower bars. }
\item{ui}{ upper end of error bars. Defaults to \code{y + uiw} or
- \code{x + uiw} depeding on \code{err}. Set to \code{NULL} omit
- upper bars. }
+ \code{x + uiw} depeding on \code{err}. Set to \code{NULL} or
+ \code{NA} to omit upper bars. }
\item{li}{ lower end of error bars. Defaults to \code{y - liw} or
- \code{x - liw} depedning on \code{err}. Set to \code{NULL} to omit
- lower bars.}
+ \code{x - liw} depedning on \code{err}. Set to \code{NULL} or
+ \code{NA} to omit lower bars.}
\item{err}{ direction for error bars. Set to "y" for vertical bars.
Set to "x" for horizontal bars. Defaults to "y".}
@@ -147,6 +147,22 @@
# better yet, just use plotmeans ... #
plotmeans( state.area ~ state.region )
+/dontshow{
+## Just for testing
+ plotCI(x=means, uiw=NA)
+ plotCI(x=means, uiw=NULL)
+ plotCI(x=means, uiw=ciw)
+ plotCI(x=means, uiw=ciw, liw=NULL)
+ plotCI(x=means, uiw=ciw, liw=NA)
+ plotCI(x=means, liw=ciw, ciw=NULL)
+ plotCI(x=means, liw=ciw, ciw=NA)
+ ciw.na <- ciw
+ ciw.na[3] <- NA
+ plotCI(x=means, uiw=ciw.na, liw=ciw)
+ plotCI(x=means, liw=ciw.na, uiw=ciw)
}
+
+}
+
\keyword{ hplot }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|