

Extremes {base}                              R Documentation

_M_a_x_i_m_a _a_n_d _M_i_n_i_m_a

_U_s_a_g_e_:

     max(..., na.rm=FALSE)
     min(..., na.rm=FALSE)

     pmax(..., na.rm=FALSE)
     pmin(..., na.rm=FALSE)

_V_a_l_u_e_:

     `max' and `min' return the maximum or minimum of all
     the values present in their arguments, as `double'.  If
     `na.rm' is `FALSE' an `NA' value in any of the argu-
     ments will cause a value of `NA' to be returned, other-
     wise `NA' values are ignored.

     `pmax' and `pmin' take several vectors 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 vectors are recycled
     if necessary.  If `na.rm' is `FALSE', `NA' values in
     the input vectors will produce `NA' values in the out-
     put.  If `na.rm' is `TRUE', `NA' values are ignored.

_S_e_e _A_l_s_o_:

     `range'.

_E_x_a_m_p_l_e_s_:

     min(5:1,pi)
     pmin(5:1, pi)
     x <- sort(rnorm(100));  cH <- 1.35
     plot(x, pmin(cH, pmax(-cH, x)), type='b', main= "Huber's function")

