能够从Shiny中选择将包含在生成的RmarkDown报告中
在我使用的闪亮框架中,用户可以直接从具有不同格式类型(PDF,HTML,Word)的闪亮生成报告。有一个textaareainput(),您可以在其中编写reprotot的描述,如果没有描述,则由于RRMarkDown中的以下代码,该报告仍将生成。
{r, results='asis',echo=F}
if(nchar(params$description) > 1){ # If there was a description specified, add it to the report
cat('\n**Description:**\n')
cat(input$description)
}
还有可能生成图的可能性,如果没有闪亮的绘图,则不会呈现报告,并且会出现错误,因为没有“ Graph()”,
{r 2 plot, echo=FALSE, fig.cap= 'Plot 1}
graph()
所以我的问题是,是否有与“ if”(nchar())类似的反应功能类似的东西,即使没有生成的图,报告的其余部分仍然会呈现? 感谢您提前提供的帮助。
In a shiny framework that I am using, the user has the ability to generate reports directly from the shiny with different format types(pdf, HTML, word). There is a textAreaInput() where you can write a description for the reprot and if there is no description, the report will still be generated due to the following code in rrmarkdown.
{r, results='asis',echo=F}
if(nchar(params$description) > 1){ # If there was a description specified, add it to the report
cat('\n**Description:**\n')
cat(input$description)
}
There is also the possibility to generate plots, and if there is no plot generated in the shiny, then the report won't be rendered and it will give an error since there is no "graph()"
{r 2 plot, echo=FALSE, fig.cap= 'Plot 1}
graph()
So my question is, is there something similar to "if(nchar())" for reactive function so even if there is no generated plot, the rest of the report will still be rendered?
thanks for all help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论