https://github.com/insightsengineering/teal.data
Data model for teal applications
https://github.com/insightsengineering/teal.data
data-model nest r
Last synced: 3 months ago
JSON representation
Data model for teal applications
- Host: GitHub
- URL: https://github.com/insightsengineering/teal.data
- Owner: insightsengineering
- License: other
- Created: 2022-03-28T14:16:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-23T03:50:57.000Z (3 months ago)
- Last Synced: 2025-03-23T11:46:45.203Z (3 months ago)
- Topics: data-model, nest, r
- Language: R
- Homepage: https://insightsengineering.github.io/teal.data/
- Size: 34.5 MB
- Stars: 11
- Watchers: 14
- Forks: 9
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-shiny-extensions - teal.data - Data model for teal applications. (Frameworks / Framework extensions)
README
# teal.data
[](https://cran.r-project.org/package=teal.data)
[](https://cran.r-project.org/package=teal.data)
[](https://cran.r-project.org/package=teal.data)
[](https://cran.r-project.org/package=teal.data)[](https://insightsengineering.github.io/teal.data/main/unit-test-report/)
[](https://insightsengineering.github.io/teal.data/)
[](https://insightsengineering.github.io/teal.data/main/coverage-report/)






[](https://www.repostatus.org/#active)
[](https://github.com/insightsengineering/teal.data/tree/main)
[](https://github.com/insightsengineering/teal.data/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)This package is used to create the data needed for `teal` applications. This data can be:
- Independent data frames
- CDISC data (for clinical trial reporting)
- Relational data
- `MultiAssayExperiment` objectsThis package provides:
- the mechanism for pulling data from existing systems
- the ability to mutate (i.e. pre-process) the data
- record the operations used to create the data to enable reproducibility## Installation
```r
install.packages('teal.data')
```Alternatively, you might want to use the development version.
```r
# install.packages("pak")
pak::pak("insightsengineering/teal.data")
```## Usage
To understand how to use this package, please refer to the [Introduction to `teal.data`](https://insightsengineering.github.io/teal.data/latest-tag/articles/teal-data.html) article, which provides multiple examples of code implementation.
Below is the showcase of the example usage.
```r
library(teal.data)
``````r
# quick start for clinical trial data
my_data <- cdisc_data(
ADSL = example_cdisc_data("ADSL"),
ADTTE = example_cdisc_data("ADTTE"),
code = quote({
ADSL <- example_cdisc_data("ADSL")
ADTTE <- example_cdisc_data("ADTTE")
})
)# or
my_data <- within(teal_data(), {
ADSL <- example_cdisc_data("ADSL")
ADTTE <- example_cdisc_data("ADTTE")
})
datanames <- c("ADSL", "ADTTE")
datanames(my_data) <- datanames
join_keys(my_data) <- default_cdisc_join_keys[datanames]
``````r
# quick start for general data
my_general_data <- within(teal_data(), {
iris <- iris
mtcars <- mtcars
})
``````r
# reproducibility check
data <- teal_data(iris = iris, code = "iris <- mtcars")
verify(data)
#> Error: Code verification failed.
#> Object(s) recreated with code that have different structure in data:
#> • iris```
```r
# code extraction
iris2_data <- within(teal_data(), {iris2 <- iris[1:6, ]})
get_code(iris2_data)
#> "iris2 <- iris[1:6, ]"
```## Getting help
If you encounter a bug or have a feature request, please file an issue. For questions, discussions, and staying up to date, please use the `teal` channel in the [`pharmaverse` slack workspace](https://pharmaverse.slack.com).
## Stargazers and Forkers
### Stargazers over time
[](https://starchart.cc/insightsengineering/teal.data)
### Stargazers
[](https://github.com/insightsengineering/teal.data/stargazers)
### Forkers
[](https://github.com/insightsengineering/teal.data/network/members)