我是R语言的初学者, 虽然我必须在R中编辑一些预先编写的代码。 有一个我不明白的具体问题。 如果有人可以帮助我理解这一点,将非常有帮助。
# Logger
log.msg = function(msg){
## capture messages and errors to a file.
fileConn<-file("output.txt", open = "a+")
writeLines(c(msg), fileConn)
close(fileConn)
}
log.msg("Start Data extraction and merging..")
答案 0 :(得分:0)
log.msg = function(msg){
## capture messages and errors to a file.
## create file connection in append mode (a+)
fileConn<-file("output.txt", open = "a+")
## write the msg to this file
writeLines(c(msg), fileConn)
## close connection
close(fileConn)
}