abs                   package:base                   R Documentation

_M_i_s_c_e_l_l_a_n_e_o_u_s _M_a_t_h_e_m_a_t_i_c_a_l _F_u_n_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions compute miscellaneous mathematical functions. The
     naming follows the standard for computer languages such as C or
     Fortran.

_U_s_a_g_e:

     abs(x)
     sqrt(x)

_A_r_g_u_m_e_n_t_s:

       x: a numeric or 'complex' vector or array.

_D_e_t_a_i_l_s:

     These are generic functions: methods can be defined for them
     individually or via the 'Math' group generic.  For complex
     arguments (and the default method), 'z', 'abs(z) == Mod(z)' and
     'sqrt(z) == z^0.5'.

_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:

     'Arithmetic' for simple, 'log' for logarithmic, 'sin' for
     trigonometric, and 'Special' for special mathematical functions.

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

     require(stats) # for spline
     xx <- -9:9
     plot(xx, sqrt(abs(xx)),  col = "red")
     lines(spline(xx, sqrt(abs(xx)), n=101), col = "pink")

