home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / Extremes < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.2 KB  |  39 lines

  1.     
  2.     _M_a_x_i_m_a _a_n_d _M_i_n_i_m_a
  3.     
  4.          max(..., na.rm=TRUE)
  5.          min(..., na.rm=TRUE)
  6.     
  7.          pmax(..., na.rm=FALSE)
  8.          pmin(..., na.rm=FALSE)
  9.     
  10.     _V_a_l_u_e:
  11.     
  12.          max and min return the maximum or minimum of all the
  13.          values present in their arguments.  If na.rm is FALSE
  14.          an NA value in any of the arguments will cause a value
  15.          of NA to be returned, otherwise NA values are ignored.
  16.     
  17.          pmax and pmin take several vectors as arguments and
  18.          return a single vector giving the parallel maxima (or
  19.          minima) of the vectors.  The first element of the
  20.          result is the maximum (minimum) of the first elements
  21.          of all the arguments, the second element of the result
  22.          is the maximum (minimum) of the second elements of all
  23.          the arguments and so on.  Shorter vectors are recycled
  24.          if necessary.  If na.rm is FALSE, NA values in the
  25.          input vectors will produce NA values in the output.  If
  26.          na.rm is TRUE, NA values are ignored.
  27.     
  28.     _S_e_e _A_l_s_o:
  29.     
  30.          range.
  31.     
  32.     _E_x_a_m_p_l_e_s:
  33.     
  34.          min(5:1,pi)
  35.          pmin(5:1, pi)
  36.          x <- sort(rnorm(100));  cH <- 1.35
  37.          plot(x, pmin(cH, pmax(-cH, x)), type='b', main= "Huber's function")
  38.     
  39.