clear: Remove variables, dataset or functions from memory

View source: R/utils.R

clearR Documentation

Remove variables, dataset or functions from memory

Description

Clear can be used to remove objects from memory (variables, data.frame, functions). Clear is easier than rm and is more secure because, by default, it ask for confirmation. Objects to remove can be specified as is or by their name ("character"). It's possible to erase all vars, all functions using keywords : "vars" or "functions" "all" keyword will allows total cleaning.

Usage

clear(what = "all", noask = FALSE)

Arguments

what

an object name, a Keyword (vars, functions, all) or a pattern Object name can be passed for evaluation, pattern has to be quotted

noask

to clear whithout confirmation. Useful when running from a script

Details

When keyword or pattern are used and there is more than one object to clear, a confirmation will be issued. Except if noask parameters is set to true If there only one object matching the exactly the what parameter, this object is removed whithout confirmation

Author(s)

Gilles Desve

References

Based on: Epi6 and Stata functionnality, available at https://github.com/.

See Also

rm

Examples

tmp <- 5
temp <- 5
temp2 <- 6
clear(tmp)
clear("t*")

Epiconcept-Paris/STRAP-epiuf documentation built on Aug. 5, 2024, 3:41 a.m.