在Rmarkdown中,我在latex代码中使用\textcolor选项,方法是:
$$
\textcolor{red}{This is Red}
$$
它在编译时将显示This is Red,但显示为红色。但是,"chunk output in console“预览选项不会加载此选项。有没有人知道快速解决的办法?我附上了它看起来是什么样子:
我的问题和别人的大不相同。请再读一遍我的问题。
目前的情况是:
在Rmarkdown中,我有以下代码:
rnorm(1)
假设我第一次运行块时得到的是0.23,输出将以rmarkdwon '0.23‘显示,然后我在rmarkdown中写到:
Now there is a random number 0.23
在设置echo=TRUE后,将执行这些代码,并再次显示代码和输出。但我不想再执行了。在第一次运行代码时,我会得到一个输出0.23。我想保留这个0.23‘并显示代码和输出,所以代码不应该再运行。
如何在重排中修复输出,并显示代码和输出,但不再次运行代码?
不要让我引用varibale
我通常希望将列表中包含的数据作为重标记文档中的分页表打印出来。如果选择了正确的df_print选项,则调用每个dataframe单独呈现所需的ouptut。然而,拥有一个列表的意义在于,数据的数量取决于传递给rmarkdown文档的参数;所以这不是真正的解决方案。
基于和 of rmarkdown::paged_table,我试图做以下工作,但没有成功。
有没有办法做到这一点呢?我很乐意使用任何与df_print选项类似的支持分页的包。
---
title: "Printing paged tables from a list of dataframes in Rmarkdown
我在RStudio中遇到了一个问题,我的rmarkdown文件中的代码在studio中运行,但不会在我的编织HTML中正确显示。例如,下面运行绘图的代码正确地运行在示例rmarkdown行中,而不是我自己的代码。在第一个图像中显示的图形应该不需要HTML中的代码。但是,它只显示了代码:
```{r echo=FALSE}
Crash_by_age,aes(年龄,Crashes_Reported,颜色=性别)
E+ geom_point()
The following code is from the sample rmarkdown document. This does display in
我正在创建一个包含从RMarkdown派生的rmarkdown::pdf_document格式的R包"mytemplate“(作为一个R脚本函数,它以报告作为输出,它调用header.tex文件):
report <- function() {
## location of resource files in the package
header <- system.file("resources/header.tex", package = "mytemplate")
## derives the style from d
我在Rmarkdown文件中有一个部分,例如: * Building your YAML spec
+ we can get all the keys each kind supports
```{bash, eval=F} #apiVersion版本: v1 #kind:服务 kubectl解释服务--递归 + sepc section
```{bash, eval=F} kubectl解释services.spec + sepc type
```{bash, eval=F} kubectl解释services.spec.type 在我渲染之后: ? 我的
当我连接到HTML时,图像在.html文件中显示得很好,但在.nb.html文件中却不显示。MWE是R笔记本模板:plot(cars)图像不显示。
根据这里列出的建议:,我尝试了较早的/更新的/开发版本的rmarkdown。我还尝试了较新的/开发版本的针织品。什么都帮不上忙。我有RStudio版本1.0.136。
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5
locale:
[1]
我有一个调用函数的r标记。该函数呈现另一个r标记文档,其中我在循环中包含kable。我无法打印在循环中调用的kable。
下面是一个代码示例:
# function definition
test.kable <- function(filename){
rmarkdown::render(filename)
}
#test.rmd
```{r,echo=FALSE,results='asis'}
对于(1:2中的i){
print(kable(head(Iris)
}
kable(尾部(虹膜))
#main r markdown in which I call the