rstudio remove all variables code example Example 1: r remove all environment rm(list = ls()) Example 2: remove everything in r #in R rm(list=ls())