【发布时间】:2014-05-05 14:42:22
【问题描述】:
我有这个数据框:
library(sendmailR)
library(pander)
dput(s)
structure(list(Description = c("ServerA", "ServerB", "ServerC",
"ServerD", "ServerE", "ServerF"), Value = c("2", "2", "100",
"100", "80", "20")), .Names = c("Description", "Value"), row.names = c(NA,
6L), class = "data.frame")
我想把这个数据框放在一个漂亮的表格中,然后通过电子邮件发送给一些人。
我用 pandoc 试过,但表格看起来很简单:
t<-pandoc.table.return(s, caption="Server CPU Utilization")
from <- "user@example.com"
to <- c("end_users@example.com")
subject <- paste(Sys.time()," Servers CPU utilization")
body <- t
mailControl=list(smtpServer="mailhost.example.net")
sendmail(from=from,to=to,subject=subject,msg=body,control=mailControl)
还有其他方法可以将数据框格式化为漂亮的表格以作为电子邮件发送吗?表格必须在电子邮件正文中,而不是作为附件。
【问题讨论】: