Removes R objects in the global environment if R object doesn't exist

rm_if_exists(r_object, envir = globalenv())

Arguments

r_object

single R object that is removed if it is present in the environment