r clean environment code example Example 1: r remove all environment rm(list = ls()) Example 2: r clean environment rm(list = ls())