Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
避免Rmarkdown中的简单功能消息_R_R Markdown - Fatal编程技术网

避免Rmarkdown中的简单功能消息

避免Rmarkdown中的简单功能消息,r,r-markdown,R,R Markdown,我不确定这是否是sf中的错误,但我无法使sf初始消息不显示在Rmarkdown中。我已经使用了我所知道的每一个命令,试图压制回应: ```{r echo=FALSE, cache=FALSE, results=FALSE, warning=FALSE, comment=FALSE, warning=FALSE} 不阻止在Rmarkdown中显示此消息 Simple feature collection with 10 features and 9 fields geometry type:

我不确定这是否是sf中的错误,但我无法使sf初始消息不显示在Rmarkdown中。我已经使用了我所知道的每一个命令,试图压制回应:

```{r echo=FALSE, cache=FALSE, results=FALSE, warning=FALSE, comment=FALSE, warning=FALSE} 
不阻止在Rmarkdown中显示此消息

Simple feature collection with 10 features and 9 fields
geometry type:  POLYGON
dimension:      XY
bbox:           xmin: -80.13852 ymin: 39.65424 xmax: -75.20251 ymax: 42.18098
epsg (SRID):    4326
proj4string:    +proj=longlat +datum=WGS84 +no_defs
添加comment=FALSE行实际上会在每一行中添加“FALSE”一词

FALSE Simple feature collection with 10 features and 8 fields
FALSE geometry type:  POLYGON
FALSE dimension:      XY
FALSE bbox:           xmin: -8920979 ymin: 4815823 xmax: -8371505 ymax: 5188128
FALSE epsg (SRID):    3857
FALSE proj4string:    +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs

使用
invisible(capture.output(*code*))
使一个简单功能的输出静音。

Add
message=FALSE
,你应该很乐意去做。当我添加它时,它仍然会显示出来。那么,任何产生输出的包都有可能使用
print
cat
来执行此操作。关于这方面有很多问题。我认为推荐的方法是将调用包装在
sink
capture.output
中。啊,好的,我在另一个SO问题中提出了这个问题。我需要使用
不可见(capture.output(*code*))
使输出静音,谢谢。