How to Clear R History?

`rm(list = ls())`

`rm(list = ls(all.names = TRUE))`

`rm(list = ls(envir = .GlobalEnv))`

`gc()`

`Ctrl + L` in RStudio Console

`Session -> Restart R` in RStudio

`.rs.restartR()` in RStudio

`history(Inf)` to view history

`savehistory(“history.Rhistory”)` to save history

`loadhistory(“history.Rhistory”)` to load history

`unlink(“~/.Rhistory”)` to delete the history file

`file.remove(“~/.Rhistory”)` to remove the history file

Suggested for You

Trending Today