r clear environment code example
Example 1: r remove all environment
rm(list = ls())
Example 2: r clean environment
rm(list = ls())
Example 3: how to clear rstudio environment
click on the brush icon in environment tab
rm(list = ls())
rm(list = ls())
click on the brush icon in environment tab