read_excel 读入消息- 抑制?
read_excel read in messages- Suppress?
我喜欢使用 readxl
包。但是,我一直将它用作 RMarkdown 文档的一部分,并且读入文件时的某些 read_excel()
消息在进行分析时很有用,但在尝试呈现分析时却没有用。所以问题是,在使用 read_excel
时,是否有任何方法可以抑制收到的消息(或与此相关的任何警告消息)?我将采用 RMarkdown 或 read_excel 解决方案。
这里是我想要禁止显示的消息类型的示例。出现在我最终的 Rmarkdown 文档中:
## Parsed with column specification:
## cols(
## .default = col_character(),
## Year = col_integer(),
## Month = col_integer(),
## Date = col_date(format = ""),
## Day = col_integer(),
## Replicate = col_integer(),
## Time = col_integer(),
## Depth = col_double(),
## DenTotal = col_integer()
## )
## See spec(...) for full column specifications.
我无法找到使用 read_excel
从 url 读取 excel 文件的方法,因此我无法在此处制作可重现的示例.
如果包使用 message
函数打印消息,那么 suppressMessages
应该可以阻止消息打印。从帮助文件中,?suppressMessages
、
evaluates its expression in a context that ignores all ‘simple’ diagnostic messages.
我喜欢使用 readxl
包。但是,我一直将它用作 RMarkdown 文档的一部分,并且读入文件时的某些 read_excel()
消息在进行分析时很有用,但在尝试呈现分析时却没有用。所以问题是,在使用 read_excel
时,是否有任何方法可以抑制收到的消息(或与此相关的任何警告消息)?我将采用 RMarkdown 或 read_excel 解决方案。
这里是我想要禁止显示的消息类型的示例。出现在我最终的 Rmarkdown 文档中:
## Parsed with column specification:
## cols(
## .default = col_character(),
## Year = col_integer(),
## Month = col_integer(),
## Date = col_date(format = ""),
## Day = col_integer(),
## Replicate = col_integer(),
## Time = col_integer(),
## Depth = col_double(),
## DenTotal = col_integer()
## )
## See spec(...) for full column specifications.
我无法找到使用 read_excel
从 url 读取 excel 文件的方法,因此我无法在此处制作可重现的示例.
如果包使用 message
函数打印消息,那么 suppressMessages
应该可以阻止消息打印。从帮助文件中,?suppressMessages
、
evaluates its expression in a context that ignores all ‘simple’ diagnostic messages.