Skip to content

Commit

Permalink
tidyup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Oct 25, 2023
1 parent 4a0aeb9 commit f3de72c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
14 changes: 10 additions & 4 deletions R/JoinKeys.R
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,16 @@ JoinKeys <- R6::R6Class( # nolint
#' @export
#'
#' @examples
#' join_keys()
#' # setting join keys
#' join_keys(
#' join_key("dataset_A", "dataset_B", c("col_1" = "col_a")),
#' join_key("dataset_A", "dataset_C", c("col_2" = "col_x", "col_3" = "col_y"))
#' )
#' join_keys(
#' join_key("dataset_A", "dataset_B", c("col_1" = "col_a"))
#' )
#' # or
#' jk <- join_keys()
#' jk["dataset_A", "dataset_B"] <- c("col_1" = "col_a")
#' jk["dataset_A", "dataset_C"] <- c("col_2" = "col_x", "col_3" = "col_y")
#'
join_keys <- function(...) {
x <- list(...)
res <- JoinKeys$new()
Expand All @@ -376,6 +378,7 @@ join_keys <- function(...) {
#' @param dataset_1 (`character`) name of first dataset.
#' @param dataset_2 (`character`) name of second dataset.
#' @export
#' @keywords internal
`[.JoinKeys` <- function(x, dataset_1, dataset_2 = NULL) {
checkmate::assert_string(dataset_1)
checkmate::assert_string(dataset_2, null.ok = TRUE)
Expand All @@ -387,6 +390,7 @@ join_keys <- function(...) {
#' @rdname sub-.JoinKeys
#' @param value value to assign
#' @export
#' @keywords internal
`[<-.JoinKeys` <- function(x, dataset_1, dataset_2 = NULL, value) {
checkmate::assert_string(dataset_1)
checkmate::assert_string(dataset_2, null.ok = TRUE)
Expand All @@ -404,6 +408,8 @@ join_keys <- function(...) {
#'
#' @export
#' @examples
#'
#' # default CDISC join keys
#' cdisc_join_keys(join_key("dataset_A", "dataset_B", c("col_1" = "col_a")), "ADTTE")
#'
cdisc_join_keys <- function(...) {
Expand Down
12 changes: 8 additions & 4 deletions man/join_keys.Rd

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

1 change: 1 addition & 0 deletions man/sub-.JoinKeys.Rd

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

0 comments on commit f3de72c

Please sign in to comment.