Learn R Programming

eponge

Keep your environment

clean

A small utility which makes selective objects removing easier.

Installation

# install.packages("devtools")
devtools::install_github("krzjoa/eponge")

Usage

Many times we can meet a situation, when we want to clean our environment selectively. Suppose we just wrote a couple of functions, which have the same names as the ones existing in already attached libraries.

filter <- function(x, id){
  x %>% 
  filter(ID == id)
}

cars <- 1:5

eponge::erase_masking()

Sometimes, we may want to tidy our messy enivironment: we have objects we would like to keep, while in the same time there are many temporary objects created during the exploration.

cars.2 <- cars
cars.2$speed <- cars.2$speed + 2

new.iris <- iris[1:20, ]

add_two <- function(x) x + 2

# Normally, we don't have to pass envir argument, because it indicates global environment by default
eponge::erase_data(envir = environment())

Package name

Package was originally named sponge, but it was changed in order to avoid name conflict with BioConductor package SPONGE. The current name comes from its French equivalent, éponge (e.pɔ̃ʒ).

Copy Link

Version

Install

install.packages('eponge')

Monthly Downloads

182

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Krzysztof Joachimiak

Last Published

March 24th, 2020

Functions in eponge (0.1.0)

erase_functions

Remove (all) functions from environment
erase

Remove (all) objects from environment
erase_df

Remove all the `data.frame` objects
erase_masking

Erase objects from GlobalEnv, which are masking objects from attached packages
erase_data

Remove all objects, which are listed in `Data` section in RStudio
eponge-package

Package eponge
erase_values

Remove all objects, which are listed in `Values` section in RStudio
erase_non_functions

Remove all the objects, that are not functions
erase_if

Remove objects, which fulfill determined conditions