| 1 |
--- |
| 2 |
title: "Temporary environment" |
| 3 |
author: "Philippe Grosjean" |
| 4 |
date: "`r Sys.Date()`" |
| 5 |
output: |
| 6 |
rmarkdown::html_vignette: |
| 7 |
toc: true |
| 8 |
toc_depth: 3 |
| 9 |
fig_caption: yes |
| 10 |
vignette: > |
| 11 |
%\VignetteIndexEntry{Temporary environment} |
| 12 |
%\VignetteEngine{knitr::rmarkdown} |
| 13 |
%\VignetteEncoding{UTF-8} |
| 14 |
--- |
| 15 |
|
| 16 |
```{r setup, include=FALSE} |
| 17 |
knitr::opts_chunk$set(collapse = TRUE, comment = "#>") |
| 18 |
library(svMisc) |
| 19 |
``` |
| 20 |
|
| 21 |
{svMisc} attaches `SciViews:TempEnv` at the fore last position in the search path, so that its content is accessible from any loaded R package (except 'base'). This environment is a convenient place where temporary items that you do not want to see in the global environment, for instance, variables related to GUI (Graphical User Interface) and that are typically a nonsense to `save()` and re`load()` in the global environment. |
| 22 |
|
| 23 |
**TODO: show a couple of case where it is useful.** |
| 24 |
|
| 25 |
The following functions are available to ease access to these variables: |
| 26 |
|
| 27 |
- `temp_env()` get the environment itself, |
| 28 |
- `assign_temp()`, `add_temp()`, and `change_temp()` place or modify data in the temporary environment, |
| 29 |
- `rm_temp()` or `delete_temp()` eliminate variables from there, |
| 30 |
- `exists_temp()` tests for the existence of objects it this environment, |
| 31 |
- `get_temp()` retrieves objects from there. |