我想将所有控制台文字重定向到一个文件中。这是我尝试过的:
> sink("test.log", type=c("output", "message"))
> a <- "a"
> a
> How come I do not see this in log
Error: unexpected symbol in "How come"
以下是我在test.log中找到的内容:
[1] "a"
以下是我想在test.log中得到的内容:
> a <- "a"
> a
[1] "a"
> How come I do not see this in log
Error: unexpected symbol in "How come"
我做错了什么?谢谢!