Description Usage Arguments Value Note Examples
alex_clean() cleans either entire R global environment from all objects, Or saves specific objects aither by name or by pattern in name or both Easy way to clean the R environment from unnecessary objects and free RAM. This function is first designed by Alexander Shemetev partially inspired by maaniB. .
1 2 3 4 | alex_clean(
except = "ca1122334455667788990011",
pattern = "ca1122334455667788990011"
)
|
except |
- name(s) of objects to preserve in R |
pattern |
- pattern in names of objects in R environment to be preserved |
A cleaned R environment with everything removed and selected objects preserved only (if any were asked to be preserved).
Object having pattern in its name: "ca1122334455667788990011" cannot be removed with this function (if such object exists in your R environment at all). This name is reserved for undeletable object.
1 2 3 4 5 | alex_clean() #cleans everything in R global environment
a = 5; b = 6; c1 = a + b; df1 = c(1, 2, 3, 4); gf1 = c(8,9,6,8); ls()
alex_clean(except = c("a", "b", "c", "d"), pattern = "df")
ls() #Your environment has only selected by user files preserved
alex_clean(pattern = "df") #only object(s) with pattern df in name are preserved in R environment
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.