【问题标题】:RShiny :Generate word document with reactive text inputR Shiny:使用反应式文本输入生成 word 文档
【发布时间】:2021-07-05 21:02:23
【问题描述】:

我想用保存的 word 模板创建一个 word 文档,并将一些反应性语句/文本(由用户从输入中选择)和数值转储到 word 文档的指定行。 我想反应性地向这个文档添加文本,并用用户输入的值填充表格。然后下载word文件。 如果有人可以指导我如何处理或提供与此类文档生成代码相关的一些示例的链接 word template

【问题讨论】:

    标签: r document shinydashboard interactive


    【解决方案1】:

    我不知道有任何软件包可以让您阅读和操作 Word 文档。但是,您可以使用 RMarkdown 创建所需的文档。该模板不是 Word 文档,而是 RMarkdown。

    文档看起来像这样(例如,参见 here for more detailsRMarkdown Cookbook):

    ---
    title: "Untitled"
    author: "Your Name"
    date: "April 20, 2021"
    output: word_document
    ---
    
    # Varieties
    
    *Varieties*: will provide seed for this trial type. Chemically-treated ... (your text)
    
        ```{r Your code snippet, echo=FALSE}
        # Use echo=FALSE to hide the R code in the document
        # CREATE A DATA FRAME "ResultsTable" HERE
        ResultsTable # Return the table to print it
        ```
    
    

    【讨论】:

      猜你喜欢
      • 2019-12-02
      • 1970-01-01
      • 1970-01-01
      • 2020-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-24
      • 1970-01-01
      相关资源
      最近更新 更多