autoload                package:base                R Documentation

_O_n-_d_e_m_a_n_d _L_o_a_d_i_n_g _o_f _P_a_c_k_a_g_e_s

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

     `autoload' creates a promise-to-evaluate `autoloader' and stores
     it with name `name' in `.AutoloadEnv' environment.  When R
     attempts to evaluate `name', `autoloader' is run, the package is
     loaded and `name' is re-evaluated in the new package's
     environment.  The result is that R behaves as if `file' was loaded
     but it does not occupy memory.

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

     autoload(name, file)
     autoloader(name, file)
     .AutoloadEnv

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

    name: string giving the name of an object

    file: string giving the name of a package containing the object

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

     This function is invoked for its side-effect.

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

     `delay', `library'

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

     autoload("line","eda")
     search()
     ls("Autoloads")
     all(ls("Autoloads") == ls(envir = .AutoloadEnv))
     data(cars)
     plot(cars)
     z<-line(cars)
     abline(coef(z))
     search()
     detach("package:eda")
     search()
     z<-line(cars)
     search()

