Let's say I am running some code in R. As an example:
x <- 1
if (x == 0.1){
print('X = 0.1')
} else if (x > 0.1){
print('X is bigger than 0.1 ')
} else {
print('X is smaller than 0.1')
}
If I look at the history file in R studio it will show me that I ran this conditional statement but it will not show me the outcome (i.e. X is bigger than 0.1).
Is there a way to automatically log the output in R or R studio?
Direct output to a log file and screen:
sink("myfilename", append=FALSE, split=TRUE) # for screen and log
Return output to the screen only:
sink()
From Quick-R
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With