Skip to content
Merged
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- methods
- rlang
- stats
- teal.code
- insightsengineering/teal.code
- utils
- yaml
- id: spell-check
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Imports:
utils
Suggests:
knitr (>= 1.42),
random.cdisc.data (>= 0.2.1),
Comment thread
averissimo marked this conversation as resolved.
rmarkdown (>= 2.23),
testthat (>= 3.2.2),
withr (>= 2.0.0)
Expand All @@ -51,7 +52,7 @@ Remotes:
insightsengineering/teal.code@main
Config/Needs/verdepcheck: insightsengineering/teal.code, mllg/checkmate,
r-lib/lifecycle, r-lib/rlang, yihui/knitr, rstudio/rmarkdown,
r-lib/testthat, r-lib/withr
insightsengineering/random.cdisc.data, r-lib/testthat, r-lib/withr
Config/Needs/website: insightsengineering/nesttemplate
Encoding: UTF-8
Language: en-US
Expand Down
140 changes: 78 additions & 62 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,92 +1,108 @@
#' Random adverse events
#' Simulated `CDISC` Data for Examples
#'
#' @description
#' This package contains random datasets that are used for testing purposes in the `teal.data` package:
#'
#' - `rADSL` Random subject-level analysis dataset
#'
#' @name random_cdisc_data
#' @docType data
#' @keywords datasets
#' @source - `rADSL`: [random.cdisc.data::cadsl]
# nolint start: line_length.
#' @format - `rADSL`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADSL)` rows and `r ncol(rADSL)` columns.
# nolint end: line_length.
#' @rdname rADSL
Comment thread
averissimo marked this conversation as resolved.
Outdated
"rADSL"

#' @description - `rADAE`: Random adverse events analysis dataset
#' @docType data
#' @usage rADAE
#' @keywords datasets internal
#' @source internal
#' @name rADAE
#' @keywords datasets
#' @source - `rADAE`: [random.cdisc.data::cadae]
# nolint start: line_length.
#' @format - `rADAE`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADAE)` rows and `r ncol(rADAE)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADAE"

#' Random concomitant medications
#'
#' @description - `rADCM`: Random concomitant medications analysis dataset
#' @docType data
#' @usage rADCM
#' @keywords datasets internal
#' @source internal
#' @name rADCM
#' @keywords datasets
#' @source - `rADCM`: [random.cdisc.data::cadcm]
# nolint start: line_length.
#' @format - `rADCM`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADCM)` rows and `r ncol(rADCM)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADCM"

#' Random response
#'
#' Random exposure.
#'
#' @description - `rADEX`: Random response analysis dataset
#' @docType data
#' @usage rADEX
#' @keywords datasets internal
#' @source internal
#' @name rADEX
#' @keywords datasets
#' @source - `rADEX`: [random.cdisc.data::cadex]
# nolint start: line_length.
#' @format - `rADEX`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADEX)` rows and `r ncol(rADEX)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADEX"

#' Random lab analysis
#'
#' @description - `rADLB`: Random laboratory data analysis dataset
#' @docType data
#' @usage rADLB
#' @keywords datasets internal
#' @source internal
#' @name rADLB
#' @keywords datasets
#' @source - `rADLB`: [random.cdisc.data::cadlb]
# nolint start: line_length.
#' @format - `rADLB`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADLB)` rows and `r ncol(rADLB)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADLB"

#' Random response
#'
#' @description - `rADRS`: Random response analysis dataset
#' @docType data
#' @usage rADRS
#' @keywords datasets internal
#' @source internal
#' @name rADRS
#' @keywords datasets
#' @source - `rADRS`: [random.cdisc.data::cadrs]
# nolint start: line_length.
#' @format - `rADRS`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADRS)` rows and `r ncol(rADRS)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADRS"

#' Random patient listing
#'
#' @docType data
#' @usage rADSL
#' @keywords datasets internal
#' @source internal
#' @name rADSL
"rADSL"

#' Random data `rADTR`
#'
#' @description - `rADTR`: Random tumor response analysis dataset
#' @docType data
#' @usage rADTR
#' @keywords datasets internal
#' @source internal
#' @name rADTR
#' @keywords datasets
#' @source - `rADTR`: [random.cdisc.data::cadtr]
# nolint start: line_length.
#' @format - `rADTR`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADTR)` rows and `r ncol(rADTR)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADTR"

#' Random time to event analysis dataset
#'
#' @description - `rADTTE`: Random time to event analysis dataset
#' @docType data
#' @usage rADTTE
#' @keywords datasets internal
#' @source internal
#' @name rADTTE
#' @keywords datasets
#' @source - `rADTTE`: [random.cdisc.data::cadtte]
# nolint start: line_length.
#' @format - `rADTTE`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADTTE)` rows and `r ncol(rADTTE)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADTTE"

#' Random data `rADVS`
#'
#' @description - `rADVS`: Random vital signs analysis dataset
#' @docType data
#' @usage rADVS
#' @keywords datasets internal
#' @source internal
#' @name rADVS
#' @keywords datasets
#' @source - `rADVS`: [random.cdisc.data::cadvs]
# nolint start: line_length.
#' @format - `rADVS`: An object of class `tbl_df` (inherits from `tbl`, `data.frame`) with `r nrow(rADVS)` rows and `r ncol(rADVS)` columns.
# nolint end: line_length.
#' @rdname rADSL
"rADVS"

#' List containing default joining keys for `CDISC` datasets
#'
#' This data object is created at loading time from `cdisc_datasets/cdisc_datasets.yaml`.
#' These represent primary and foreign keys for joining `CDISC` datasets.
#'
#' @name default_cdisc_join_keys
#' @usage default_cdisc_join_keys
#' @docType data
#' @source internal
#' @source internal. See `data-raw/cdisc_datasets.yaml` and `data-raw/data.R` for details.
#' @seealso [join_keys()]
#' @examples
#' default_cdisc_join_keys
#' default_cdisc_join_keys[c("ADSL", "ADAE")] # Subset for ADSL and ADAE
"default_cdisc_join_keys"
5 changes: 3 additions & 2 deletions R/dummy_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#' Retrieves example CDISC datasets for use in examples and testing.
#'
#' This function returns a dummy dataset and should only be used within `teal.data`.
#' Note that the datasets are not created and maintained in `teal.data`, they are retrieved its dependencies.
#' Note that the datasets are not created and maintained in `teal.data`, they are retrieved from
#' [`random.cdisc.data`][random.cdisc.data::random.cdisc.data-package] package.
#'
#' @param dataname (`character(1)`) name of a CDISC dataset
#' @param dataname (`character(1)`) name of a CDISC dataset.
#'
#' @return A CDISC dataset as a `data.frame`.
#'
Expand Down
14 changes: 14 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ navbar:
href: unit-test-report-non-cran/
github:
icon: fa-github
aria-label: View on Github
href: https://github.com/insightsengineering/teal.data

articles:
Expand Down Expand Up @@ -56,3 +57,16 @@ reference:
- col_labels<-
- col_relabel
- example_cdisc_data
- title: Built-in datasets
desc: >
Random CDISC synthetic data generated from `{random.cdisc.data}` package.
contents:
- rADSL
- rADAE
- rADLB
- rADCM
- rADEX
- rADRS
- rADTR
- rADTTE
- rADVS
18 changes: 9 additions & 9 deletions data-raw/data.R
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
## code to prepare `data` for testing examples
rADAE <- random.cdisc.data::cadae # nolint: object_name_linter.
rADAE <- random.cdisc.data::cadae # nolint: object_name.
usethis::use_data(rADAE)

rADCM <- random.cdisc.data::cadcm # nolint: object_name_linter.
rADCM <- random.cdisc.data::cadcm # nolint: object_name.
usethis::use_data(rADCM)

rADEX <- random.cdisc.data::cadex # nolint: object_name_linter.
rADEX <- random.cdisc.data::cadex # nolint: object_name.
usethis::use_data(rADEX)

rADLB <- random.cdisc.data::cadlb # nolint: object_name_linter.
rADLB <- random.cdisc.data::cadlb # nolint: object_name.
usethis::use_data(rADLB)

rADRS <- random.cdisc.data::cadrs # nolint: object_name_linter.
rADRS <- random.cdisc.data::cadrs # nolint: object_name.
usethis::use_data(rADRS)

rADSL <- random.cdisc.data::cadsl # nolint: object_name_linter.
rADSL <- random.cdisc.data::cadsl # nolint: object_name.
usethis::use_data(rADSL)

rADTR <- random.cdisc.data::cadtr # nolint: object_name_linter.
rADTR <- random.cdisc.data::cadtr # nolint: object_name.
usethis::use_data(rADTR)

rADTTE <- random.cdisc.data::cadtte # nolint: object_name_linter.
rADTTE <- random.cdisc.data::cadtte # nolint: object_name.
usethis::use_data(rADTTE)

rADVS <- random.cdisc.data::cadvs # nolint: object_name_linter.
rADVS <- random.cdisc.data::cadvs # nolint: object_name.
usethis::use_data(rADVS)

## Code to prepare default CDISC datasets for `teal.data`
Expand Down
11 changes: 9 additions & 2 deletions man/default_cdisc_join_keys.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/example_cdisc_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions man/rADAE.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADCM.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADEX.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADLB.Rd

This file was deleted.

Loading
Loading