# [Rd] minor error in documentation of pmax in base (PR#2513)

**Liaw, Andy
**
andy_liaw@merck.com

*Fri Jan 31 18:47:03 2003*

If I'm not mistaken, matrices and arrays are just vectors with dim
attribute. so I'm not surprised that pmax and pmin work as they do. You
get the same answer by the following:
array(pmax(1:24, 24:1), c(2, 3, 4))
array(pmin(1:24, 24:1), c(2, 3, 4))
Cheers,
Andy
>* -----Original Message-----
*>* From: baron@cattell.psych.upenn.edu
*>* [mailto:baron@cattell.psych.upenn.edu]
*>* Sent: Friday, January 31, 2003 12:37 PM
*>* To: r-devel@stat.math.ethz.ch
*>* Cc: R-bugs@biostat.ku.dk
*>* Subject: [Rd] minor error in documentation of pmax in base (PR#2513)
*>*
*>*
*>* The documentation says, "pmax and pmin take several vectors as
*>* arguments and return a single vector giving the parallel maxima
*>* (or minima) of the vectors."
*>*
*>* I discovered that, if you use a matrix or array instead of a
*>* vector, pmax returns a matrix or array, respectively.
*>*
*>* This makes pmax and pmin much more useful, and should not be left
*>* to people to discover on their own!
*>*
*>* For example:
*>* m1 <- array(1:24,c(2,3,4))
*>* m2 <- array(24:1,c(2,3,4))
*>* pmax(m1,m2)
*>* pmin(m1,m2)
*>*
*>* Jon Baron
*>*
*>* ______________________________________________
*>* R-devel@stat.math.ethz.ch mailing list
*>* http://www.stat.math.ethz.ch/mailman/listinfo/r-devel
*>*
*
------------------------------------------------------------------------------