[R] pmax and sort?

rkevinburton at charter.net rkevinburton at charter.net
Tue Jan 13 01:55:44 CET 2009


I am having a hard time understanding the documentation and I was wondering if there would be someone to help clear the cobwebs. 

The documentation for pmax states:

pmax and pmin take one or more vectors (or matrices) as arguments and return a single vector giving the ‘parallel’ maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs are recycled if necessary. attributes (such as names or dim) are transferred from the first argument (if applicable). 

This descirption seems to me like what sort would return. Would someone please help me understand the differenece between pmax and sort?

Thank you.

Kevin




More information about the R-help mailing list