rpremraj / mailR

A utility to send emails from the R programming environment
http://rpremraj.github.io/mailR/
190 stars 57 forks source link

Send a formatted table via mailR #89

Open scvcampos opened 4 years ago

scvcampos commented 4 years ago

I'm trying to send a table in a body email using R. But it doesn't work. The function is "send.mail" and I used body = print(xtable(test_1),print.results=FALSE)

This is how I received the email:

% latex table generated in R 3.5.1 by xtable 1.8-4 package % Fri Oct 25 18:00:23 2019 \begin{table}[ht] \centering \begin{tabular}{rrrrrrr} \hline & Nível Atual & Nível Anterior & 08/2019 & 07/2019 & 06/2019 & 05/2019 \ \hline Richmond FED & 8.00 & -9.00 & 1.00 & -12.00 & 2.00 & 7.00 \ Shipments & 4.00 & -14.00 & 5.00 & -13.00 & 5.00 & 1.00 \ Capacity Utilization & 49.70 & 46.00 & 45.10 & 47.90 & 53.20 & 50.00 \ Number of employees & 13.00 & 3.00 & -6.00 & -3.00 & 4.00 & 16.00 \ Wages & 15.00 & 24.00 & 22.00 & 20.00 & 25.00 & 36.00 \ Average workweek & 10.00 & -10.00 & 4.00 & -9.00 & 1.00 & 5.00 \ \hline \end{tabular} \end{table}

Can someone help me? Maybe with another function? Thanks!

igorfarah commented 4 years ago

Try to use like this: body = print(xtable(DATA_FRAME, caption = "Title"), type="html", caption.placement = "top", include.rownames = FALSE)