r                   package:svMisc                   R Documentation

_A _v_e_r_y _s_i_l_e_n_t _a_n_d _m_u_l_t_i_p_a_c_k_a_g_e _r_e_q_u_i_r_e() _f_u_n_c_t_i_o_n

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

     This function loads one or several R packages as silently as
     possible and it returns 'TRUE' only if all packages are loaded
     successfully. If at least one loading fails, a short message is
     printed.

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

         r(...)

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

     ...: the name of one or several R packages to load (character
          strings) 

_V_a_l_u_e:

     'TRUE' if all packages are loaded correctly, 'FALSE' otherwise.
     This function is designed to concisely and quitely indicate
     package requirements in GUI menu or other GUI actions.

_A_u_t_h_o_r(_s):

     Philippe Grosjean <phgrosjean@sciviews.org>

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

     'require'

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

     # This should work...
     if (r("tools", "methods")) cat("Fine!\n")
     # ... but this not (notice there is no error or warning!)
     if (r("tools", "badname")) cat("Fine!\n")

