

is.R {base}                                  R Documentation

_A_r_e _w_e _u_s_i_n_g _R_, _r_a_t_h_e_r _t_h_a_n _S_?

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

     Test if running under R.

_U_s_a_g_e_:

     is.R()

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

     The function has been written such as to correctly run
     in all versions of R, S and S-PLUS.  In order for code
     to be runnable in both R and S dialects, either your
     the code must define `is.R' or use it as

     `if (exists(is.R) && is.function(is.R) && is.R()) {'
     `    '.br `} else {'
     `    '.br `}'

_V_a_l_u_e_:

     `is.R' returns `TRUE' if we are using R and `FALSE'
     otherwise.

_S_e_e _A_l_s_o_:

     `R.version', `system'.

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

     x <- runif(20); small <- x < 0.4
     # which only exists in R:
     if(is.R()) which(small) else seq(along=small)[small]

