SyntaxFix
Write A Post
Hire A Developer
Questions
Another option for RStudio is rstudioapi::sendToConsole("\014"). This will work even if output is diverted.
rstudioapi::sendToConsole("\014")
sink("out.txt") cat("\014") # Console not cleared rstudioapi::sendToConsole("\014") # Console cleared sink()