在r中使用时,请卸下前导支架

在r中使用时,请卸下前导支架,r,printing,cat,R,Printing,Cat,我想在r中打印Sys.time(),不带前导括号 例如: print(sprintf("Triggered at: %s", Sys.time()),quote = FALSE) 输出: [1] Triggered at: 2018-04-30 10:51:12 但我希望结果是一样的 Triggered at: 2018-04-30 10:51:12 我试过用cat来做这个,但是没有用 cat(Sys.time()) 输出 1525058622 你就快到了。试一试 cat(sprint

我想在r中打印Sys.time(),不带前导括号

例如:

print(sprintf("Triggered at: %s", Sys.time()),quote = FALSE)
输出:

[1] Triggered at: 2018-04-30 10:51:12
但我希望结果是一样的

Triggered at: 2018-04-30 10:51:12
我试过用cat来做这个,但是没有用

cat(Sys.time())
输出

1525058622

你就快到了。试一试

cat(sprintf("Triggered at: %s\n", Sys.time()))
#Triggered at: 2018-04-30 13:27:50

它很有魅力,我浪费了1个多小时。非常感谢。我很快就会接受答案(10分钟后),这是一个系统限制。“我浪费了超过1个多小时。”我也在那里@Toros91;-)还有
消息
-
消息(粘贴0(“触发时间:”,Sys.time())
@symbolicaxau:谢谢,非常有趣。我会把这个留着以后用。