-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
88 lines (62 loc) · 1.86 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(boxes)
box_delete("test")
```
# boxes: store and retrieve arbitrary R objects
<a href="https://github.com/markheckmann/boxes"><img src="man/figures/logo.png" align="right" height="138" /></a>
<!-- badges -->
[![R](https://img.shields.io/badge/language-R-blue)]()
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange)]()
<!-- badges -->
The goal of `boxes` is to provide a convenient way to store R objects or arbitrary files (plus additional notes) and retrieve them again later.
To use the package, you need to know a few terms:
* `box`: A container to store things. Things can be R objects or files.
* `item`: Anything stored inside a box.
* `pack`: Adding an item to a box.
* `pick`: Retrieving an item from a box.
Boxes are stored on your disk. Hence, anything put into it will remain there until you delete the box.
Technically, each box is a separate SQLite database. You can create as many boxes as you need.
## Installation
You can install the dev version of `boxes` like so:
```{r eval=FALSE}
devtools::install_github("markheckmann/boxes")
```
## Usage
Load package and show existings boxes. A box with your username exists by default.
```{r example}
library(boxes)
boxes()
```
Create a new box and see that it is empty.
```{r new-box}
box_create("test")
box_active()
box()
```
Add a new object to the box.
```{r pack}
pack(mtcars, "my_data", "Data to keep for later")
box()
```
Retrieve an object from a box and remove it.
```{r pick}
x <- pick("my_data")
identical(x, mtcars)
remove("my_data")
```
Check if item is gone and delete box.
```{r delete}
box()
box_delete("test")
boxes()
```