safe.write              package:RSQLite              R Documentation

_W_r_i_t_e _a _d_a_t_a._f_r_a_m_e _a_v_o_i_d_i_n_g _e_x_c_e_e_d_i_n_g _m_e_m_o_r_y _l_i_m_i_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function batches calls to `write.table' to avoid exceeding
     memory limits for very large data.frames.

_U_s_a_g_e:

     safe.write(value, file, batch, ..., quote.string=FALSE)

_A_r_g_u_m_e_n_t_s:

   value: a data.frame;

    file: a file object (connection, file name, etc).

   batch: maximum number of rows to write at a time.

     ...: any other arguments are passed to `write.table'.

quote.string: logical value passed to `write.table'.

_D_e_t_a_i_l_s:

     The function has a while loop invoking `write.table' for subsets
     of `batch' rows of `value'.  Since this is a helper function for
     `mysqlWriteTable' has hardcoded other arguments to `write.table'.

_V_a_l_u_e:

     `NULL', invisibly.

_N_o_t_e:

     No error checking whatsoever is done.

_S_e_e _A_l_s_o:

     `write.table'

_E_x_a_m_p_l_e_s:

        ctr.file <- file("dump.sqloader", "w")
        safe.write(big.data, file = ctr.file, batch = 25000)

