Sys.getenv               package:base               R Documentation

_G_e_t _E_n_v_i_r_o_n_m_e_n_t _V_a_r_i_a_b_l_e_s

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

     'Sys.getenv' obtains the values of the environment variables named
     by 'x'.

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

     Sys.getenv(x)

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

       x: a character vector, or missing

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

     A vector of the same length as 'x', with the variable names as its
     'names' attribute.  Each element holds the value of the
     environment variable named by the corresponding component of 'x'
     (or '""' if no environment variable with that name was found).

     On most platforms 'Sys.getenv()' will return a named vector giving
     the values of all the environment variables.

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

     'Sys.putenv', 'Sys.getlocale' for the locale "environment",
     'getwd' for the working directory.

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

     ## whether HOST is set will be shell-dependent e.g. Solaris' csh does not.
     Sys.getenv(c("R_HOME", "R_PAPERSIZE", "R_PRINTCMD", "HOST"))

     str(s <- Sys.getenv()) # all settings (rather do not print)

     ## Language and Locale settings -- but rather use Sys.getlocale()
     s[grep("^L(C|ANG)", names(s))]

