lubridate-消息 [英] lubridate - messages

查看:80
本文介绍了lubridate-消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用类似功能时,是否可以禁止显示诸如正在使用日期格式..."之类的消息?

Will it be possible to suppress messages such as "Using date format..." when using a function like?

> ymd(vec)
Using date format %Y%m%d

虽然这些在投射向量时很容易看到,但在某些情况下可能会很烦人.

Whilst these are good to see when you are casting a vector, it can be annoying in some circumstances.

推荐答案

ymd代码,它调用parse_date,它通过命令message给出那些烦人的消息.

Looking at the ymd code, it callse parse_date, which gives those annoying messages via the command message.

?message,有一个对应的suppressMessages:

suppressMessages(ymd(x))

(注意-其他类似的功能是suppressWarningssuppressPackageStartupMessagescapture.output,过去我不得不使用所有这些功能来停止出现意外的文本位(我正在将一些位输出到HTML文件,这些文件不希望包含在其中)).

(Note - other similar functions are suppressWarnings, suppressPackageStartupMessages, and capture.output, all of which I have had to use in the past to stop unexpected bits of text turning up (I was outputting some bits to an HTML file and these didn't want these to be in it)).

这篇关于lubridate-消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆