Extremes                package:base                R Documentation

_M_a_x_i_m_a _a_n_d _M_i_n_i_m_a

_D_e_s_c_r_i_p_t_i_o_n:

     Returns the (parallel) maxima and minima of the input values.

_U_s_a_g_e:

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

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

_A_r_g_u_m_e_n_t_s:

     ...: numeric arguments.

   na.rm: a logical indicating whether missing values should be
          removed.

_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 arguments will cause a value of `NA' to
     be returned, otherwise `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 output.  If `na.rm' is
     `TRUE', `NA' values are ignored. `attributes' (such as `names' or
     `dim') are transferred from the first argument (if applicable).

_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
     pmin(cH, quantile(x)) # no names
     pmin(quantile(x), cH) # has names
     plot(x, pmin(cH, pmax(-cH, x)), type='b', main= "Huber's function")

