withVisible              package:utils              R Documentation

_R_e_t_u_r_n _b_o_t_h _a _v_a_l_u_e _a_n_d _i_t_s _v_i_s_i_b_i_l_i_t_y

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

     This function evaluates an expression, returning it in a two
     element list containing its value and a flag showing whether it
     would automatically print.

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

     withVisible(x)

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

       x: An expression to be evaluated. 

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

     The argument is evaluated in the caller's context.

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

  value : The value of 'x' after evaluation.

visible : logical; whether the value would auto-print.

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

     'invisible', 'eval'

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

     x <- 1
     withVisible(x <- 1)
     x
     withVisible(x)

     # Wrap the call in evalq() for special handling

     df <- data.frame(a=1:5, b=1:5)
     evalq(withVisible(a + b), envir=df)

