Data Object Management
The following functions are useful for data object management in R:
[table id=19 /]
Simple Tricks to Manage Objects in Memory
For example, some handy data management commands appear below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# remove all objects in the global environment rm(list=ls()) # remove all objects except object a rm(list = ls()[-a] # remove only function objects rm(list=lsf.str()) # remove data objects, but preserve function objects rm(list = setdiff(ls(), lsf.str())) # remove everything, but keep objects a and b ls()[!(ls() %in% c("a","b"))] # remove all objects with temp in the name rm(list=ls(pattern="temp")) # remove all objects starting with abc rm(ls(pattern="^abc")) |