R/clear_console.R

Defines functions clear_console

Documented in clear_console

#' Clear the Console
#' 
#' @description 
#' This function clears the console. 
#' 
#' In RStudio, Console is located in the lower 
#' 
#' left panel where previously-executed codes
#' 
#' and their outputs are displayed. 
#' 
#' @export
#' 
#' @examples
#' \dontrun{
#' 
#' clear_console()
#' }
#' 
clear_console <- function(){

  cat("\014")
  cat("\f")

  # if (as.character(Sys.info()['sysname'])=="Windows"){
  #   cat("\014") #Sends CTRL+L to the Console
  #   cat("\f") #Sends CTRL+L to the Console
  # } else {
  #   cat("\014") #Sends CTRL+L to the Console
  # }
  #
  # # Remove all variables from memory to start fresh
  # rm(list=ls())
  # # If there are plots, delete them to start fresh
  # if (length(dev.list())!= 0) dev.off()
  # 

}
1moein/listentodata documentation built on Nov. 14, 2024, 5:35 p.m.