How to assign output of cat to an object?

前端 未结 5 832
萌比男神i
萌比男神i 2020-12-15 04:34

How would it be possible in the example below to skip the step of writing to file \"test.txt\", i.e. assign the cat-result to an object, and still achieve the same end resul

5条回答
  •  隐瞒了意图╮
    2020-12-15 05:16

    Try the following codes:

    writeLines(capture.out((summary(lm(hwy~cyl*drv,data=mpg)),con="summary.txt",sep="\n")

    Then you can open the txt file "summary.txt" to see your results.

提交回复
热议问题