median package:stats R Documentation _M_e_d_i_a_n _V_a_l_u_e _D_e_s_c_r_i_p_t_i_o_n: Compute the sample median. _U_s_a_g_e: median(x, na.rm = FALSE) _A_r_g_u_m_e_n_t_s: x: an object for which a method has been defined, or a numeric vector containing the values whose median is to be computed. na.rm: a logical value indicating whether 'NA' values should be stripped before the computation proceeds. _D_e_t_a_i_l_s: This is a generic function for which methods can be written. However, the default method makes use of 'sort' and 'mean' from package 'base' both of which are generic, and so the default method will work for most classes (e.g. '"Date"') for which a median is a reasonable concept. _V_a_l_u_e: The default method returns a length-one object of the same type as 'x', except when 'x' is integer of even length, when the result will be double. If there are no values or if 'na.rm = FALSE' and there are 'NA' values the result is 'NA' of the same type as 'x' (or more generally the result of 'x[FALSE][NA]'). _R_e_f_e_r_e_n_c_e_s: Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S Language_. Wadsworth & Brooks/Cole. _S_e_e _A_l_s_o: 'quantile' for general quantiles. _E_x_a_m_p_l_e_s: median(1:4)# = 2.5 [even number] median(c(1:3,100,1000))# = 3 [odd, robust]