首页 > 解决方案 > 如何让 R 在 MacOS 上说出/说出当前时间?

问题描述

我可以让 R 使用system命令说/说短语。

例如: system("say What time is it?")

我怎么得到它,所以说当前时间?

有人会认为是这样的: system("say the current time is Sys.time()")

会工作,但它不会。

标签: rdatetimetime

解决方案


如此处所述,您可以使用 MacOS日期功能

system("say the current time is `date +%H:%M`")

推荐阅读