HTMLInitFile             package:R2HTML             R Documentation

_B_e_g_i_n_s / _E_n_d_s _a _n_e_w _H_T_M_L _r_e_p_o_r_t _o_u_t_p_u_t

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

     Those two functions handle the beginning and the ending of a HTML
     report, by writing the HTML
     <body><head><title></title></head>...</body> tags and their
     options. When working manually, the user may need to use it's own
     functions or to explicitly write to a file using cat("", file=).

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

     HTMLInitFile(outdir = tempdir(),filename="index",extension="html",HTMLframe=FALSE, BackGroundColor = "FFFFFF", BackGroundImg = "", Title = "R output",CSSFile="R2HTML.css",useLaTeX=TRUE,useGrid=TRUE)
     HTMLEndFile(file = .HTML.file)

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

  outdir: directory to store the output 

filename: target HTML report filename 

extension: target HTML report extension (htm, html,...)  

HTMLframe: should the output be handled by frames [boolean] 

BackGroundColor: option bgcolor for HTML tag <body>

BackGroundImg: option background for HTML tag <body>

   Title: string to pass to HTML <title> tag  

 CSSFile: path and name of a CSS file to use 

useLaTeX: boolean - add required references to javascript AsciiMathML
          in order to use 'as.latex'

 useGrid: boolean - add required references to javascript grid in order
          to use R2HTML grid fonctions

    file: target HTML file to end

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

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

     physical path of the main HTML file that will serve for the
     report.

_N_o_t_e:

     For a discussion about .HTML.file default value for file argument,
     refer to 'HTMLStart'

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

     Eric Lecoutre

_R_e_f_e_r_e_n_c_e_s:

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

     'HTML', 'as.latex', 'HTMLgrid'

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

             # Store in target the name of a output file
             dir.create(file.path(tempdir(),"R2HTML"))
             target <- HTMLInitFile(file.path(tempdir(),"R2HTML"),"index", BackGroundColor="#BBBBEE")
             # Use target to write a dataframe
             HTML(as.title("Here is the data frame"),file=target)
             HTML("<br>Don't forget to use the CSS file in order to benefit from fixed size police",file=target)
             tmp <- as.data.frame(matrix(rnorm(100),ncol=10))
             HTML(tmp,file=target)
             HTMLEndFile()

