[R] trouble with html() in Hmisc

Mark Difford mark_difford at yahoo.co.uk
Sat Oct 3 20:08:45 CEST 2009


Liviu,

>> Does this mean that Hmisc produces LyX code (as opposed to LaTeX code)?

No. Sorry for confusing you: it means that html does not know what
tabularnewline means, it cannot interpret it. My reply showed where the
problem lies and how to fix it.

You need to add the following command to the preamble of the *.tex file:
\providecommand{\tabularnewline}{\\}

Regards, Mark.


Liviu Andronic wrote:
> 
> Hello
> 
> On 10/3/09, Mark Difford <mark_difford at yahoo.co.uk> wrote:
>> This has nothing to do with Hmisc or hevea.
>>
> Although I have LyX installed, I don't quite understand where LyX
> comes into play. The R code in the original e-mail takes a table-like
> object and transforms it into LaTeX; then html() calls hevea to conver
> .tex to .html and opens a browser to display the result.
> 
> 
>>  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
>>  %% Because html converters don't know tabularnewline
>>  \providecommand{\tabularnewline}{\\}
>>
> 
> If I print the `latex' object from the previous e-mail, I get the
> offending "tabularnewline".
>> data(Angell)
>> .object <- cor(Angell[,1:2], use="complete.obs")
>> tmp <- latex(.object, cdec=c(2,2), file="", title="")
> % latex.default(.object, cdec = c(2, 2), file = "", title = "")
> %
> \begin{table}[!tbp]
>  \begin{center}
>  \begin{tabular}{lrr}\hline\hline
> \multicolumn{1}{l}{}&\multicolumn{1}{c}{moral}&\multicolumn{1}{c}{hetero}\tabularnewline
> \hline
> moral&$ 1.00$&$-0.59$\tabularnewline
> hetero&$-0.59$&$ 1.00$\tabularnewline
> \hline
> \end{tabular}
> 
> \end{center}
> 
> \end{table}
> 
> 
> Does this mean that Hmisc produces LyX code (as opposed to LaTeX code)?
> Liviu
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/trouble-with-html%28%29-in-Hmisc-tp25721612p25731240.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list