home *** CD-ROM | disk | FTP | other *** search
-
- _S_w_e_e_p _o_u_t _A_r_r_a_y _S_u_m_m_a_r_i_e_s
-
- sweep(x, MARGIN, STATS, FUN="-", ...)
-
- _A_r_g_u_m_e_n_t_s:
-
- x : an array.
-
- MARGIN : a giving the extents of x which correspond to
- STATS.
-
- STATS : the summary statistic which is to be swept
- out.
-
- FUN : the function to be used to carry out the
- sweep. In the case of binary operators such
- as "/" etc., the function name must be
- quoted.
-
- ... : optional arguments to FUN.
-
- _V_a_l_u_e:
-
- An array with the same shape as x, but with the summary
- statistics swept out.
-
- _S_e_e _A_l_s_o:
-
- apply.
-
- _E_x_a_m_p_l_e_s:
-
- data(attitude)
- med.att <- apply(attitude, 2, median)
- sweep(data.matrix(attitude), 2, med.att)# subtract the column medians
-
-