remove all objects in R code example Example 1: remove everything in r #in R rm(list=ls()) Example 2: remove all objects in R rm(list = ls(all.names = TRUE))