【发布时间】:2015-02-26 01:37:44
【问题描述】:
我正在尝试弄清楚如何使用 downloadButton 将多个内容下载到一个 pdf 文件中。我在 ui 中创建了下载按钮:
downloadButton('downloadData', 'Download Data'))
我正在尝试将多个绘图和表格放入一个 pdf 文件中。我在服务器文件中有以下
output$downloadData <- downloadHandler(
filename = function() {
paste('data-', Sys.Date(), '.pdf', sep=”)
}
但我认为这会保存多个 csv 文件。如何从渲染中下载多个绘图和表格,例如
output$table<-renderTable({
P.Value<- c(lev.p,bart.p,turn.p,shap.p,jar.p,linm.p)
Test.Statistic<-c(lev.s,bart.s,turn.s,shap.s,jar.s,linm.s)
df<-data.frame(P.Value,Test.Statistic)
rownames(df, do.NULL = TRUE, prefix = "row")
rownames(df) <- c("Levene Test","Bartlett Test","Turning Point Test","Shapiro-Wilk Test","Jarque Bera Test","Linear Model Constant Drift Test")
df
})
,
output$qq.line<-renderPlot({
index<-1:length(lg.ret.vec())
model<-lm((lg.ret.vec())~ index)
plot(model,which=2,main="QQ plot of the residuals",xlab="Theoretical Quantiles")
qqline(rstandard(model),col="black")
})
,
output$histogram<-renderPlot({
hist(lg.ret(),main="Histogram of log returns",xlab="Log returns")
})
仅举几例。
【问题讨论】: