【问题标题】:Rmarkdown - pdf output - stop iterations from printingRmarkdown - pdf输出 - 停止打印迭代
【发布时间】:2020-10-24 01:48:45
【问题描述】:

我正在尝试生成 Rmarkdown pdf 输出。

函数 RankAggreg()(来自 RankAggreg 包)在分析期间运行多次迭代,这些迭代也打印在我的 pdf 输出中。

有人知道如何在我的 pdf 输出中停止打印迭代吗? 我尝试使用所有可能的结果变化 = "hide"、echo、include 但没有任何帮助。

---
title: "<center> Example <center>"
output:
  pdf_document:
    fig_caption: yes
    toc: yes
    toc_depth: 3
    number_sections: true
    latex_engine: xelatex
  fontsize: 10pt
  
header-includes:
- \pagenumbering{gobble}
---
library(rmarkdown)
library(tinytex)
library(knitr)
knitr::opts_chunk$set(echo=TRUE, warning=FALSE, message=FALSE, cache = TRUE)

library(RankAggreg)

data(geneLists)

RA_results_seedlings <- RankAggreg(
  geneLists, 10, method = c("CE"), distance = c("Spearman"), 
  seed = 100, rho = 0.1, standardizeWeights = TRUE)

【问题讨论】:

    标签: r pdf printing iteration r-markdown


    【解决方案1】:

    当您直接在特定块中设置results = "hide" 时,文本输出被隐藏,PDF 中仅显示绘图:

    ---
    title: "Untitled"
    output: pdf_document
    ---
    
    ```{r, results = "hide"}
    library(RankAggreg)
    
    data(geneLists)
    
    RA_results_seedlings <- RankAggreg(
      geneLists, 10, method = c("CE"), distance = c("Spearman"), 
      seed = 100, rho = 0.1, standardizeWeights = TRUE)
    ```
    

    (使用knitr::opts_chunk$set() 对我也不起作用。)

    【讨论】:

      【解决方案2】:

      您应该在RankAggreg() 函数中添加verbose = FALSE

      RA_results_seedlings <- RankAggreg(
      geneLists, 10, method = c("CE"), distance = c("Spearman"), 
      seed = 100, rho = 0.1, standardizeWeights = TRUE,
      verbose = FALSE)
      

      【讨论】:

        猜你喜欢
        • 2019-03-20
        • 2020-06-25
        • 1970-01-01
        • 1970-01-01
        • 2018-01-30
        • 1970-01-01
        • 2021-04-02
        • 1970-01-01
        • 2022-01-09
        相关资源
        最近更新 更多