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
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.