You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/teal-data.Rmd
+15-14Lines changed: 15 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,21 @@ vignette: >
11
11
# Introduction
12
12
13
13
The `teal.data` package specifies the data format used in `teal` applications.
14
-
The `teal_data` class inherits from [`qenv`](https://insightsengineering.github.io/teal.code/latest-tag/articles/qenv.html) and is meant to be used for reproducibility purposes.
14
+
15
+
16
+
A `teal_data` is meant to be used for reproducibility purposes. The class inherits from [`qenv`](https://insightsengineering.github.io/teal.code/latest-tag/articles/qenv.html) and we encourage to get familiar with [`teal.code`](https://insightsengineering.github.io/teal.code/latest-tag/) first. `teal_data` has following characteristics:
17
+
18
+
- It inherits from the environment and methods such as `$`, `get()`, `ls()`, `as.list()` work out of the box.
19
+
-`teal_data` is a locked environment, and data modification is only possible through the `teal.code::eval_code()` and `within.qenv()` functions.
20
+
- It stores metadata about the code used to create the data (see [reproducibility](#reproducibility)).
21
+
- It supports slicing by `[`.
22
+
- It is immutable which means that each code evaluation does not modify the original `teal_data` environment directly.
23
+
- It maintains information about relationships between datasets (see [Join Keys](#relational-data-models)).
15
24
16
25
## Quick Start
17
26
18
27
To create an object of class `teal_data`, use the `teal_data` function.
19
-
`teal_data` has a number of methods to manage relevant information in private class slots.
28
+
`teal_data` has a number of methods to interact with the object.
20
29
21
30
```{r, results = 'hide', message = FALSE}
22
31
library(teal.data)
@@ -46,23 +55,14 @@ get_code(my_data)
46
55
47
56
# get code just for specific object
48
57
get_code(my_data, names = "data2")
58
+
49
59
# get datanames
50
60
names(my_data)
51
61
52
62
# print
53
63
print(my_data)
54
64
```
55
65
56
-
57
-
## `teal_data` characteristics
58
-
59
-
A `teal_data` object keeps the following information:
60
-
61
-
-`env` - an environment containing data.
62
-
-`code` - a string containing code to reproduce `env` (details in [reproducibility](teal-data-reproducibility.html)).
63
-
-`names` - a character vector listing objects of interest to `teal` modules (details in [this `teal` vignette](https://insightsengineering.github.io/teal/latest-tag/articles/including-data-in-teal-applications.html)).
64
-
-`join_keys` - a `join_keys` object defining relationships between datasets (details in [Join Keys](join-keys.html)).
65
-
66
66
### Reproducibility
67
67
68
68
The primary function of `teal_data` is to provide reproducibility of data.
@@ -104,8 +104,8 @@ join_keys(my_data["child"])
104
104
105
105
### Hidden objects
106
106
107
-
An object is hidden in `teal_data` if its name starts with a dot (`.`).
108
-
This can be used to pass auxiliary objects / function in the `teal_data` instance, without being visible in the `teal` summary and filter panel.
107
+
An object is hidden in `teal_data` if its name starts with a dot (`.`). This can be used to pass auxiliary objects in
108
+
the `teal_data` instance, without being visible in the `teal` summary and filter panel.
0 commit comments