cache                package:Biobase                R Documentation

_E_v_a_l_u_a_t_e _a_n _e_x_p_r_e_s_s_i_o_n _i_f _i_t_s _v_a_l_u_e _i_s _n_o_t _a_l_r_e_a_d_y _c_a_c_h_e_d.

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

     Cache the evaluation of an expression in the file system.

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

         cache(name, expr)

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

    name: A character of length 1.

    expr: An expression.

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

     This function can be useful during the development of
     computationally intensive workflows, for example in vignettes or
     scripts. The function uses a cache file in the current working
     directory whose name is obtained by 'paste("tmp-", name, ".RData",
     sep="")'.

     When 'cache' is called and the cache file exists, it is loaded and
     the object whose name is given by 'name' is returned. 'expr' is
     _not_ evaluted.

     When 'cache' is called and the cache file does not exist, 'expr'
     is evaluted, and its value is saved into the file under the name
     given by 'name' and returned.

     To delete all cache files, command like 'rm tmp-*' should do.

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

     The (cached) value of 'expr'.

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

     Wolfgang Huber, huber@ebi.ac.uk

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

         myComplicatedObject <- cache("myComplicatedObject", { runif(10) })

