How do I log an R session to a file?

前端 未结 4 1908
日久生厌
日久生厌 2020-12-17 09:04

Other than through redirection, which captures an entire session, is there a way to start and stop logging during an R session? To clarify, I am looking for something simil

4条回答
  •  情书的邮戳
    2020-12-17 09:44

    For the sake of completing the answer using sink

    # copy the log to a text file
    sink("./logofcode.txt")
    Your R code(s) goes here
    you can use a stored R code as well using source()
    source("./XS_SPEC_CF.R",echo=T, max.deparse.length=1e3)
    sink()
    

提交回复
热议问题