write.htmltable          package:arrayMagic          R Documentation

_W_r_i_t_e _a _d_a_t_a _f_r_a_m_e _i_n_t_o _a_n _h_t_m_l _t_a_b_l_e _w_i_t_h_i_n _a _h_t_m_l _p_a_g_e

_D_e_s_c_r_i_p_t_i_o_n:

     Write a 'data.frame' into an html table within a html page

_U_s_a_g_e:

     write.htmltable(x, filename, title="", sortby=NULL, decreasing=TRUE,
         open="wt", formatNumeric=function(x) paste(signif(x, 3)))

_A_r_g_u_m_e_n_t_s:

       x: 'data.frame'.

filename: character. File name.

   title: character. Title of html page.

  sortby: character. Name of column by which to sort the table rows.

decreasing: logical. Should the sort order be increasing or decreasing?

    open: character. This argument is passed on to 'file'.

formatNumeric: function that takes a numeric and returns a character.
          This function is called for all numeric values in the table.

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     The function is called for its side effect: writing a file.

_A_u_t_h_o_r(_s):

     Wolfgang Huber <URL: http://www.dkfz.de/mga/whuber>

_S_e_e _A_l_s_o:

     'writeToFile'

_E_x_a_m_p_l_e_s:

     out = tempfile()

     n  = 10
     ex = data.frame(genename=paste("Gene", 1:n, sep=""),
                     score   =signif(16*runif(n)),
                     database=paste("http://super.data.base/?id", round(1e9*runif(n)), sep=""))

     write.htmltable(ex, out, "Hi there", sortby="score")

     cat("Now have a look at ", out, ".html\n", sep="")

