registryKeyExists        package:SWinRegistry        R Documentation

_Q_u_e_r_y _f_o_r _e_x_i_s_t_e_n_c_e _o_f _k_e_y _i_n _r_e_g_i_s_t_r_y

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

     This function is used to query whether a particular key exists
     within the registry. It allows one to check before accessing the
     key and potentially generating an error. This is useful so that we
     don't have to use numerous 'try'-'catch' blocks to handle errors,
     and it also avoids  displaying error messages.

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

     registryKeyExists(path = "", top = .BuiltinKeys[1])

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

    path: the path within the registry, relative to the  top-level key
          identified by 'top', or  the entire path.

     top: an identifier for one of the built-in  top-level keys in
          which to resolve the path components.

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

     This merely tries to open the key and returns whether this was
     successful or not.

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

     A logical value indicating whether the key exists and can be read.

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

     Duncan Temple Lang <duncan@wald.ucdavis.edu>

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/SWinRegistry>

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

     'createRegistryKey' 'getRegistrySubKeyNames' 'getRegistry'
     'getRegistryKeyValues'

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

       # See if R has been registered.
      registryKeyExists("HKEY_LOCAL_MACHINE\Software\R-core")

       # See if SNormal is registerd.
       registryKeyExists("SNormal")

       # Check the top-level key HKEY_CLASSES_ROOT exists
       registryKeyExists()

       # This fails on my machine as the Performance information
       # is not registered.
       try(registryKeyExists(top = .BuiltinKeys[8]))

