r - sharing 2 data tables through sendmailR -
i using below code share data frame "my_data1" friend , code working fine. have data frame "my_data2" want share. please suggest , how should add second table in code
library(sendmailr) library(pander) <- "<me@gmail.com>" <- "<friend@gmail.com>" subject <- "important report of day!!" body <- "this result of test:" mailcontrol=list(smtpserver="aspmx.l.google.com") #----------------------------------------------------- #----------------------------------------------------- msg_content <- mime_part(paste('<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> </head> <body><pre>', paste(pander_return(pander(my_data1, style="multiline", caption = "net bookings")), collapse = '\n'), '</pre></body> </html>')) msg_content[["headers"]][["content-type"]] <- "text/html" sendmail(from=from,to=to,subject=subject,msg=msg_content,control=mailcontrol)
adding <p><pre>', paste(pander_return(pander(my_data2, style="multiline", caption = "new caption")), collapse = '\n'), '</pre>
between </pre>
, </body>
should give desired result.
when want insert text between 2 tables, can do:
<p>the text want insert between tables</p> <pre>', paste(pander_return(pander(my_data2, style="multiline", caption = "new caption")), collapse = '\n'), '</pre>
Comments
Post a Comment