简体   繁体   English

在编织为PDF时限制Rstudio(3.1.1)中的函数输出

[英]Limit Output of Function in Rstudio (3.1.1) when Knitting to PDF

I would like to limit the number of lines that are produced from a function when I knit my markdown document in R. I've looked around quite a lot but can't find a solution. 当我在R中编织我的降价文档时,我想限制从函数生成的行数。我已经看了很多但是找不到解决方案。

My code is below, it gives 50+ lines of data when run. 我的代码如下,它在运行时提供50多行数据。 My goal is to only have 9 lines of code produced by the sedist function. 我的目标是只有sedist函数生成9行代码。

```{r, results=1:9}
sedist(FILENAME, method="correlation")
```

I have tried using {r, message=1:9} , {r, Hide=1:9} , {r, height=1:9} , {r, results='hide'} and similar. 我尝试过使用{r, message=1:9}{r, Hide=1:9}{r, height=1:9}{r, results='hide'}等。

Something like this?? 这样的事情?

```{r R.options=list(max.print=10)}
df <- data.frame(x=1:100,y=1:100)
df
```

The R.options chunk option in knitr allows you to set any of R's options locally for that chunk. knitrR.options块选项允许您在本地为该块设置R的任何选项。 Look at ?options for a list of the options you can set 查看?options ,列出您可以设置的选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM