如何使用tracemem函数抑制代码块中的knitr / RMarkdown“eval eval withVisible ...”输出?

时间:2015-11-22 10:07:20

标签: r rstudio knitr r-markdown

我有一个简单的RMarkdown文档:

---
title: "Untitled"
author: "Author"
date: "November 22, 2015"
output: html_document
---

```{r}
x <- 1:10
tracemem(x)
x[2] <- 22
```

当我将其编织成HTML(使用RStudio - &gt; Knit HTML按钮)时,它会显示tracemem的一个奇怪输出(“ eval eval withVisible ... ”):

x <- 1:10
tracemem(x)
## [1] "<0x32b7c28>"
x[2] <- 22
## tracemem[0x32b7c28 -> 0x33cda68]: eval eval withVisible withCallingHandlers handle evaluate_call <Anonymous> in_dir block_exec call_block process_group.block process_group withCallingHandlers process_file <Anonymous> <Anonymous>
## tracemem[0x33cda68 -> 0x2bcd818]: eval eval withVisible withCallingHandlers handle evaluate_call <Anonymous> in_dir block_exec call_block process_group.block process_group withCallingHandlers process_file <Anonymous> <Anonymous>

如果我直接运行相同的代码(在R中没有knitr或通过“run current chunk”),我会按预期得到输出:

> x <- 1:10
> tracemem(x)
[1] "<0x504eee0>"
> x[2] <- 22
tracemem[0x504eee0 -> 0x5063460]: 
tracemem[0x5063460 -> 0x4feec68]:

这些奇怪的“eval eval withVisible ...”消息来自何处以及如何抑制它们?

0 个答案:

没有答案
相关问题