diff --git a/R/Queue.R b/R/Queue.R index 4709a267..cdd22252 100644 --- a/R/Queue.R +++ b/R/Queue.R @@ -2,7 +2,9 @@ #' @title R6 Class - A First-In-First-Out Abstract Data Type #' -#' @description `r lifecycle::badge("experimental")`\cr +#' @description +#' `r lifecycle::badge("experimental")` +#' #' Abstract data type that stores and returns any number of elements. #' #' A `Queue` object stores all elements in a single vector, diff --git a/R/call_utils.R b/R/call_utils.R index 2583a864..93408355 100644 --- a/R/call_utils.R +++ b/R/call_utils.R @@ -1,8 +1,10 @@ #' Checks `varname` argument and convert to call #' #' Checks `varname` type and parse if it's a `character` -#' @param varname (`name`, `call` or `character(1)`)\cr -#' name of the variable +#' +#' @param varname (`name`, `call` or `character(1)`) +#' name of the variable +#' #' @keywords internal #' call_check_parse_varname <- function(varname) { @@ -373,12 +375,9 @@ call_extract_matrix <- function(dataname = ".", row = NULL, column = NULL) { #' Compose extract call with `$` operator #' -#' @param dataname (`character(1)` or `name`) -#' name of the object -#' @param varname (`character(1)` or `name`) -#' name of the slot in data -#' @param dollar (`logical(1)`)\cr -#' whether returned call should use `$` or `[[` operator +#' @param dataname (`character(1)` or `name`) name of the object +#' @param varname (`character(1)` or `name`) name of the slot in data +#' @param dollar (`logical(1)`) whether returned call should use `$` or `[[` operator #' #' @return `$` or `[[` call #' diff --git a/R/column_functions.R b/R/column_functions.R index 171c4e2f..2f6df03e 100644 --- a/R/column_functions.R +++ b/R/column_functions.R @@ -8,7 +8,7 @@ #' #' @return A named character vector with the non-key columns of the `data`. #' -#' @references [data_extract_srv] +#' @references [data_extract_srv()] get_dataset_prefixed_col_names <- function(data) { if (!is.null(attr(data, "filter_and_columns")$columns) && attr(data, "filter_and_columns")$columns != "") { paste(attr(data, "dataname"), attr(data, "filter_and_columns")$columns, sep = ".") diff --git a/R/data_extract_module.R b/R/data_extract_module.R index 959ad2ed..dfaf14a5 100644 --- a/R/data_extract_module.R +++ b/R/data_extract_module.R @@ -44,36 +44,31 @@ cond_data_extract_single_ui <- function(ns, single_data_extract_spec) { #' #' @description `r lifecycle::badge("experimental")` #' This functionality should be used in the encoding panel of your `teal` app. -#' It will allow app-developers to specify a [data_extract_spec] object. +#' It will allow app-developers to specify a [data_extract_spec()] object. #' This object should be used to `teal` module variables being filtered data #' from `CDISC` datasets. You can use this function in the same way as any -#' [shiny module](https://shiny.rstudio.com/articles/modules.html) UI. +#' [`shiny module`](https://shiny.rstudio.com/articles/modules.html) UI. #' The corresponding server module can be found in [data_extract_srv()]. #' #' @param id (`character`) shiny input unique identifier #' @param label (`character`) Label above the data extract input #' @param data_extract_spec (`list` of `data_extract_spec`) -#' This is the outcome of listing [data_extract_spec] -#' constructor calls. +#' This is the outcome of listing [data_extract_spec()] constructor calls. #' @param is_single_dataset (`logical`) FALSE to display the dataset widget #' #' @return shiny [shiny::selectInput]`s` that allow to define how to extract data from #' a specific dataset. The input elements will be returned inside a [shiny::div] container. #' #' There are three inputs that will be rendered -#' \enumerate{ -#' \item{Dataset select}{ Optional. If more than one [data_extract_spec] is handed over -#' to the function, a shiny [shiny::selectInput] will be rendered. Else just the name -#' of the dataset is given. -#' } -#' \item{Filter Panel }{Optional. If the [data_extract_spec] contains a -#' filter element a shiny [shiny::selectInput] will be rendered with the options to -#' filter the dataset. -#' } -#' \item{Select panel }{A shiny [shiny::selectInput] to select columns from the dataset to -#' go into the analysis. -#' } -#' } +#' +#' 1. Dataset select Optional. If more than one [data_extract_spec] is handed over +#' to the function, a shiny [shiny::selectInput] will be rendered. Else just the name +#' of the dataset is given. +#' 2. Filter Panel Optional. If the [data_extract_spec] contains a +#' filter element a shiny [shiny::selectInput] will be rendered with the options to +#' filter the dataset. +#' 3. Select panel A shiny [shiny::selectInput] to select columns from the dataset to +#' go into the analysis. #' #' The output can be analyzed using `data_extract_srv(...)`. #' @@ -252,32 +247,30 @@ check_data_extract_spec_react <- function(datasets, data_extract) { #' Extraction of the selector(s) details #' #' @description `r lifecycle::badge("stable")` +#' #' Extracting details of the selection(s) in [data_extract_ui] elements. #' #' @inheritParams shiny::moduleServer -#' @param datasets (`FilteredData` or `list` of `reactive` or non-`reactive` `data.frame`)\cr -#' object containing data either in the form of `FilteredData` or as a list of `data.frame`. -#' When passing a list of non-reactive `data.frame` objects, they are converted to reactive `data.frame`s internally. -#' When passing a list of reactive or non-reactive `data.frame` objects, the argument `join_keys` is required also. -#' @param data_extract_spec (`data_extract_spec` or a list of `data_extract_spec`)\cr -#' A list of data filter and select information constructed by [data_extract_spec]. +#' @param datasets (`FilteredData` or `list` of `reactive` or non-`reactive` `data.frame`) +#' object containing data either in the form of `FilteredData` or as a list of `data.frame`. +#' When passing a list of non-reactive `data.frame` objects, they are converted to reactive `data.frame`s internally. +#' When passing a list of reactive or non-reactive `data.frame` objects, the argument `join_keys` is required also. +#' @param data_extract_spec (`data_extract_spec` or a list of `data_extract_spec`) +#' A list of data filter and select information constructed by [data_extract_spec]. #' @param ... #' an additional argument `join_keys` is required when `datasets` is a list of `data.frame`. #' It shall contain the keys per dataset in `datasets`. #' -#' @return -#' A reactive `list` containing following fields: -#' -#' \itemize{ -#' \item{`filters`: }{A list with the information on the filters that are applied to the data set.} -#' \item{`select`: }{The variables that are selected from the dataset.} -#' \item{`always_selected`: }{The column names from the data set that should always be selected.} -#' \item{`reshape`: }{Whether reshape long to wide should be applied or not.} -#' \item{`dataname`: }{The name of the data set.} -#' \item{`internal_id`: }{The `id` of the corresponding shiny input element.} -#' \item{`keys`: }{The names of the columns that can be used to merge the data set.} -#' \item{`iv`:}{A `shinyvalidate::InputValidator` containing `validator` for this `data_extract`} -#' } +#' @return A reactive `list` containing following fields: +#' +#' * `filters`: A list with the information on the filters that are applied to the data set. +#' * `select`: The variables that are selected from the dataset. +#' * `always_selected`: The column names from the data set that should always be selected. +#' * `reshape`: Whether reshape long to wide should be applied or not. +#' * `dataname`: The name of the data set. +#' * `internal_id`: The `id` of the corresponding shiny input element. +#' * `keys`: The names of the columns that can be used to merge the data set. +#' * `iv`: A `shinyvalidate::InputValidator` containing `validator` for this `data_extract` #' #' @references [data_extract_srv] #' diff --git a/R/data_extract_spec.R b/R/data_extract_spec.R index 09ffccfd..f839f905 100644 --- a/R/data_extract_spec.R +++ b/R/data_extract_spec.R @@ -12,23 +12,21 @@ #' @rdname data_extract_spec #' #' @section Module Development: -#' \describe{ #' `teal.transform` uses this object to construct a UI element in a module. -#' } #' -#' @param dataname (`character`)\cr -#' The name of the dataset to be extracted. -#' @param select (`NULL`, `select_spec`-S3 class or `delayed_select_spec`)\cr -#' Columns to be selected from the input dataset -#' mentioned in `dataname`. The setup can be created using [select_spec] function. -#' @param filter (`NULL` or `filter_spec` or its respective delayed version)\cr -#' Setup of the filtering of key columns inside the dataset. -#' This setup can be created using the [filter_spec] function. -#' Please note that if both select and filter are set to NULL, then the result will be a filter spec UI with all -#' variables as possible choices and a select spec with multiple set to `TRUE`. -#' @param reshape (`logical`)\cr -#' whether reshape long to wide. Note that it will be used only in case of long dataset with multiple -#' keys selected in filter part. +#' @param dataname (`character`) +#' The name of the dataset to be extracted. +#' @param select (`NULL`, `select_spec`-S3 class or `delayed_select_spec`) +#' Columns to be selected from the input dataset +#' mentioned in `dataname`. The setup can be created using [select_spec] function. +#' @param filter (`NULL` or `filter_spec` or its respective delayed version) +#' Setup of the filtering of key columns inside the dataset. +#' This setup can be created using the [filter_spec] function. +#' Please note that if both select and filter are set to NULL, then the result will be a filter spec UI with all +#' variables as possible choices and a select spec with multiple set to `TRUE`. +#' @param reshape (`logical`) +#' whether reshape long to wide. Note that it will be used only in case of long dataset with multiple +#' keys selected in filter part. #' #' @examples #' adtte_filters <- filter_spec( diff --git a/R/get_dplyr_call.R b/R/get_dplyr_call.R index 2ed1c073..c430945b 100644 --- a/R/get_dplyr_call.R +++ b/R/get_dplyr_call.R @@ -4,8 +4,8 @@ #' same selector - same dataset, same filter configuration and same reshape status #' @inheritParams get_merge_call #' -#' @return (\code{list}) simplified selectors with aggregated set of filters, -#' selections, reshapes etc. All necessary data for merging +#' @return (`list`) simplified selectors with aggregated set of filters, +#' selections, reshapes etc. All necessary data for merging #' @keywords internal #' get_dplyr_call_data <- function(selector_list, join_keys = teal.data::join_keys()) { @@ -121,12 +121,12 @@ get_dplyr_call_data <- function(selector_list, join_keys = teal.data::join_keys( #' #' Parse filter, select, rename and reshape call #' @inheritParams get_dplyr_call_data -#' @param idx optional (\code{integer}) current selector index in all selectors list -#' @param dplyr_call_data (\code{list}) simplified selectors with aggregated set of filters, -#' selections, reshapes etc. All necessary data for merging +#' @param idx optional (`integer`) current selector index in all selectors list +#' @param dplyr_call_data (`list`) simplified selectors with aggregated set of filters, +#' selections, reshapes etc. All necessary data for merging #' @param data (`NULL` or named `list`). #' -#' @return (\code{call}) filter, select, rename and reshape call +#' @return (`call`) filter, select, rename and reshape call #' #' @examples #' # use non-exported function from teal.transform @@ -246,11 +246,11 @@ get_dplyr_call <- function(selector_list, return(final_call) } -#' Parse \code{dplyr} select call +#' Parse `dplyr` select call #' -#' @param select (\code{character}) vector of selected column names +#' @param select (`character`) vector of selected column names #' -#' @return (\code{call}) \code{dplyr} select call +#' @return (`call`) `dplyr` select call #' #' @examples #' # use non-exported function from teal.transform @@ -269,12 +269,12 @@ get_select_call <- function(select) { as.call(c(list(quote(dplyr::select)), lapply(select, as.name))) } -#' Returns \code{dplyr} filter call +#' Returns `dplyr` filter call #' -#' @param filter (\code{list}) Either list of lists or list with \code{select} and \code{selected} items. -#' @param dataname (\code{NULL} or \code{character}) name of dataset. -#' @param datasets (\code{NULL} or \code{named `list`}). -#' @return (\code{call}) \code{dplyr} filter call +#' @param filter (`list`) Either list of lists or list with `select` and `selected` items. +#' @param dataname (`NULL` or `character`) name of dataset. +#' @param datasets (`NULL` or named `list`). +#' @return (`call`) `dplyr` filter call #' #' @examples #' # use non-exported function from teal.transform @@ -408,13 +408,14 @@ rename_duplicated_cols <- function(x, internal_id, selected_cols, all_cols) { ) } -#' Returns \code{dplyr} rename call +#' Returns `dplyr` rename call #' #' Rename is used only if there are duplicated columns #' #' @inheritParams get_dplyr_call #' -#' @return (\code{call}) \code{dplyr} rename call +#' @return (`call`) `dplyr` rename call +#' #' @references get_rename_dict #' #' @examples @@ -489,11 +490,11 @@ get_rename_call <- function(selector_list = list(), as.call(append(quote(dplyr::rename), internal)) } -#' Returns \code{dplyr} reshape call +#' Returns `dplyr` reshape call #' #' @inheritParams get_dplyr_call #' -#' @return (\code{list}) list of multiple \code{dplyr} calls that reshape data +#' @return (`list`) list of multiple `dplyr` calls that reshape data #' #' @examples #' # use non-exported function from teal.transform @@ -573,7 +574,7 @@ get_reshape_call <- function(selector_list = list(), #' Get pivot longer columns #' #' Get values names which are spread into columns. -#' @param selector one element of selector_list obtained by \code{get_dplyr_call_data}. +#' @param selector one element of selector_list obtained by `get_dplyr_call_data`. #' @keywords internal #' get_pivot_longer_col <- function(selector) { @@ -584,7 +585,7 @@ get_pivot_longer_col <- function(selector) { #' Get unite columns #' #' Get key names which spreads values into columns. Reshape is done only -#' on keys which are in \code{filter_spec}. +#' on keys which are in `filter_spec`. #' @inheritParams get_pivot_longer_col #' @keywords internal #' diff --git a/R/get_merge_call.R b/R/get_merge_call.R index a000ca29..59410446 100644 --- a/R/get_merge_call.R +++ b/R/get_merge_call.R @@ -145,18 +145,16 @@ get_merge_key_grid <- function(selector_list, join_keys = teal.data::join_keys() #' @param selector_to (`list`) `data_extract_srv` #' @param key_from (`character`) keys used in the first selector while joining #' -#' @details This function covers up to now 4 cases -#' \itemize{ -#' \item{dataset without parent }{ Primary keys are returned} -#' \item{dataset source = dataset target}{ -#' The primary keys subtracted of all key columns that -#' get purely filtered. This means just one value would -#' be left after filtering inside this column. Then it -#' can be taken out. -#' } -#' \item{target `dataname` is parent }{ foreign keys} -#' \item{any other case }{foreign keys} -#' } +#' @details +#' This function covers up to now 4 cases +#' +#' * dataset without parent: Primary keys are returned +#' * dataset source = dataset target: +#' The primary keys subtracted of all key columns that get purely filtered. +#' This means just one value would be left after filtering inside this column. +#' Then it can be taken out. +#' * target `dataname` is parent foreign keys +#' * any other case foreign keys #' #' @return (`character`) #' @keywords internal @@ -335,10 +333,11 @@ get_dropped_filters <- function(selector) { #' Gets the relabel call #' -#' @description `r lifecycle::badge("stable")` +#' `r lifecycle::badge("stable")` +#' #' @inheritParams merge_datasets -#' @param columns_source \code{named list}\cr -#' where names are column names, values are labels + additional attribute `dataname` +#' @param columns_source named `list` +#' where names are column names, values are labels + additional attribute `dataname` #' #' @return (`call`) to relabel `dataset` and assign to `anl_name`. #' @@ -404,9 +403,11 @@ get_anl_relabel_call <- function(columns_source, datasets, anl_name = "ANL") { #' Create relabel call from named character #' #' @description `r lifecycle::badge("stable")` +#' #' Function creates relabel call from named character. -#' @param labels (`named character`)\cr -#' where name is name is function argument name and value is a function argument value. +#' +#' @param labels (`named character`) +#' where name is name is function argument name and value is a function argument value. #' #' @return (`call`) object with relabel step #' @examples diff --git a/R/merge_datasets.R b/R/merge_datasets.R index d987ca5a..31c9d454 100644 --- a/R/merge_datasets.R +++ b/R/merge_datasets.R @@ -261,9 +261,12 @@ merge_selectors <- function(selector_list) { #' Validate data_extracts in merge_datasets #' #' Validate selected inputs from data_extract before passing to data_merge to avoid -#' \code{dplyr} errors or unexpected results +#' `dplyr` errors or unexpected results +#' #' @inheritParams merge_datasets -#' @return \code{NULL} if check is successful +#' +#' @return `NULL` if check is successful +#' #' @keywords internal #' check_data_merge_selectors <- function(selector_list) { diff --git a/R/merge_expression_module.R b/R/merge_expression_module.R index 7c0a9250..063ca2eb 100644 --- a/R/merge_expression_module.R +++ b/R/merge_expression_module.R @@ -6,18 +6,19 @@ #' Compare the example below with that found in [merge_expression_srv()]. #' #' @inheritParams shiny::moduleServer -#' @param datasets (named `list` of `reactive` or non-`reactive` `data.frame`)\cr -#' object containing data as a list of `data.frame`. When passing a list of non-reactive `data.frame` objects, they are -#' converted to reactive `data.frame` objects internally. -#' @param join_keys (`join_keys`)\cr -#' of variables used as join keys for each of the datasets in `datasets`. -#' This will be used to extract the `keys` of every dataset. -#' @param data_extract (named `list` of `data_extract_spec`)\cr -#' @param merge_function (`character(1)`)\cr -#' A character string of a function that -#' accepts the arguments `x`, `y` and `by` to perform the merging of datasets. -#' @param anl_name (`character(1)`)\cr -#' Name of the analysis dataset. +#' @param datasets (named `list` of `reactive` or non-`reactive` `data.frame`) +#' object containing data as a list of `data.frame`. +#' When passing a list of non-reactive `data.frame` objects, they are +#' converted to reactive `data.frame` objects internally. +#' @param join_keys (`join_keys`) +#' of variables used as join keys for each of the datasets in `datasets`. +#' This will be used to extract the `keys` of every dataset. +#' @param data_extract (named `list` of `data_extract_spec`) +#' @param merge_function (`character(1)`) +#' A character string of a function that accepts the arguments `x`, `y` and +#' `by` to perform the merging of datasets. +#' @param anl_name (`character(1)`) +#' Name of the analysis dataset. #' #' @return reactive expression with output from [merge_expression_srv()]. #' @@ -191,26 +192,31 @@ merge_expression_module.list <- function(datasets, #' Data merge module server #' -#' @description `r lifecycle::badge("experimental")` -#' @details When additional processing of the `data_extract` list input is required, `merge_expression_srv()` can be -#' combined with `data_extract_multiple_srv()` or `data_extract_srv()` to influence the `selector_list` input. -#' Compare the example below with that found in [merge_expression_module()]. +#' `r lifecycle::badge("experimental")` +#' +#' When additional processing of the `data_extract` list input is required, +#' `merge_expression_srv()` can be combined with `data_extract_multiple_srv()` +#' or `data_extract_srv()` to influence the `selector_list` input. +#' Compare the example below with that found in [merge_expression_module()]. #' #' @inheritParams shiny::moduleServer -#' @param datasets (named `list` of `reactive` or non-`reactive` `data.frame`)\cr -#' object containing data as a list of `data.frame`. When passing a list of non-reactive `data.frame` objects, they are -#' converted to reactive `data.frame` objects internally. -#' @param join_keys (`join_keys`)\cr -#' of variables used as join keys for each of the datasets in `datasets`. -#' This will be used to extract the `keys` of every dataset. -#' @param selector_list (`reactive`)\cr -#' output from [data_extract_multiple_srv()] or a reactive named list of outputs from [data_extract_srv()]. -#' When using a reactive named list, the names must be identical to the shiny ids of the respective -#' [data_extract_ui()]. -#' @param merge_function (`character(1)` or `reactive`)\cr +#' @param datasets (named `list` of `reactive` or non-`reactive` `data.frame`) +#' object containing data as a list of `data.frame`. When passing a list of +#' non-reactive `data.frame` objects, they are converted to reactive +#' `data.frame` objects internally. +#' @param join_keys (`join_keys`) +#' of variables used as join keys for each of the datasets in `datasets`. +#' This will be used to extract the `keys` of every dataset. +#' @param selector_list (`reactive`) +#' output from [data_extract_multiple_srv()] or a reactive named list of +#' outputs from [data_extract_srv()]. +#' When using a reactive named list, the names must be identical to the shiny +#' ids of the respective +#' [data_extract_ui()]. +#' @param merge_function (`character(1)` or `reactive`) #' A character string of a function that accepts the arguments #' `x`, `y` and `by` to perform the merging of datasets. -#' @param anl_name (`character(1)`)\cr +#' @param anl_name (`character(1)`) #' Name of the analysis dataset. #' #' @return reactive expression with output from [merge_datasets()]. diff --git a/R/select_spec.R b/R/select_spec.R index fa03729b..a981e718 100644 --- a/R/select_spec.R +++ b/R/select_spec.R @@ -1,39 +1,39 @@ #' Column selection input specification #' #' @description `r lifecycle::badge("stable")` -#' \code{select_spec} is used inside `teal` to create a \code{\link[shiny]{selectInput}} +#' `select_spec` is used inside `teal` to create a [shiny::selectInput()] #' that will select columns from a dataset. #' -#' @param choices (\code{character}) or (\code{delayed_data}) object. +#' @param choices (`character`) or (`delayed_data`) object. #' Named character vector to define the choices -#' of a shiny \code{\link[shiny]{selectInput}}. These have to be columns in the -#' dataset defined in the \code{\link{data_extract_spec}} where this is called. -#' \code{delayed_data} objects can be created via \code{\link{variable_choices}} or \code{\link{value_choices}}. +#' of a shiny [shiny::selectInput()]. These have to be columns in the +#' dataset defined in the [data_extract_spec()] where this is called. +#' `delayed_data` objects can be created via [variable_choices()] or [value_choices()]. #' -#' @param selected optional (\code{character} or \code{NULL} or \code{all_choices} or \code{delayed_data} object). -#' Named character vector to define the selected values of a shiny \code{\link[shiny]{selectInput}}. +#' @param selected optional (`character` or `NULL` or `all_choices` or `delayed_data` object). +#' Named character vector to define the selected values of a shiny [shiny::selectInput()]. #' Passing an `all_choices()` object indicates selecting all possible choices. -#' Defaults to the first value of \code{choices} or \code{NULL} for delayed data loading. +#' Defaults to the first value of `choices` or `NULL` for delayed data loading. #' -#' @param multiple (\code{logical}) Whether multiple values shall be allowed in the -#' shiny \code{\link[shiny]{selectInput}}. +#' @param multiple (`logical`) Whether multiple values shall be allowed in the +#' shiny [shiny::selectInput()]. #' -#' @param fixed optional (\code{logical}). \code{\link{data_extract_spec}} specific feature to -#' hide the choices selected in case they are not needed. Setting fixed to \code{TRUE} +#' @param fixed optional (`logical`). [data_extract_spec()] specific feature to +#' hide the choices selected in case they are not needed. Setting fixed to `TRUE` #' will not allow the user to select columns. It will then lead to a selection of #' columns in the dataset that is defined by the developer of the app. #' -#' @param always_selected (\code{character}) Additional column names from the data set that should +#' @param always_selected (`character`) Additional column names from the data set that should #' always be selected #' #' @param ordered (`logical(1)`) Flags whether selection order should be tracked. #' -#' @param label optional (\code{character}). Define a label on top of this specific -#' shiny \code{\link[shiny]{selectInput}}. The default value is \code{"Select"}. +#' @param label optional (`character`). Define a label on top of this specific +#' shiny [shiny::selectInput()]. The default value is `"Select"`. #' -#' @return A \code{select_spec}-S3 class object or \code{delayed_select_spec}-S3-class object. +#' @return A `select_spec`-S3 class object or `delayed_select_spec`-S3-class object. #' It contains all input values. -#' If \code{select_spec}, then the function double checks the \code{choices} and \code{selected} inputs. +#' If `select_spec`, then the function double checks the `choices` and `selected` inputs. #' #' #' @rdname select_spec diff --git a/man/Queue.Rd b/man/Queue.Rd index 59125c61..3effafac 100644 --- a/man/Queue.Rd +++ b/man/Queue.Rd @@ -4,7 +4,8 @@ \alias{Queue} \title{R6 Class - A First-In-First-Out Abstract Data Type} \description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}\cr +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} + Abstract data type that stores and returns any number of elements. A \code{Queue} object stores all elements in a single vector, diff --git a/man/call_check_parse_varname.Rd b/man/call_check_parse_varname.Rd index cefe5756..a6637ff3 100644 --- a/man/call_check_parse_varname.Rd +++ b/man/call_check_parse_varname.Rd @@ -7,7 +7,7 @@ call_check_parse_varname(varname) } \arguments{ -\item{varname}{(\code{name}, \code{call} or \code{character(1)})\cr +\item{varname}{(\code{name}, \code{call} or \code{character(1)}) name of the variable} } \description{ diff --git a/man/call_extract_list.Rd b/man/call_extract_list.Rd index d4438b5c..e07237dc 100644 --- a/man/call_extract_list.Rd +++ b/man/call_extract_list.Rd @@ -7,14 +7,11 @@ call_extract_list(dataname, varname, dollar = TRUE) } \arguments{ -\item{dataname}{(\code{character(1)} or \code{name}) -name of the object} +\item{dataname}{(\code{character(1)} or \code{name}) name of the object} -\item{varname}{(\code{character(1)} or \code{name}) -name of the slot in data} +\item{varname}{(\code{character(1)} or \code{name}) name of the slot in data} -\item{dollar}{(\code{logical(1)})\cr -whether returned call should use \code{$} or \code{[[} operator} +\item{dollar}{(\code{logical(1)}) whether returned call should use \code{$} or \code{[[} operator} } \value{ \code{$} or \code{[[} call diff --git a/man/check_data_merge_selectors.Rd b/man/check_data_merge_selectors.Rd index 7f34874b..64f4dd3d 100644 --- a/man/check_data_merge_selectors.Rd +++ b/man/check_data_merge_selectors.Rd @@ -7,9 +7,11 @@ check_data_merge_selectors(selector_list) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} } \value{ diff --git a/man/data_extract_multiple_srv.Rd b/man/data_extract_multiple_srv.Rd index 353c7b01..d22c17d4 100644 --- a/man/data_extract_multiple_srv.Rd +++ b/man/data_extract_multiple_srv.Rd @@ -34,7 +34,7 @@ data_extract_multiple_srv(data_extract, datasets, ...) The names of the elements in the list need to correspond to the \code{ids} passed to \code{data_extract_ui}. See example for details.} -\item{datasets}{(\code{FilteredData} or \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame})\cr +\item{datasets}{(\code{FilteredData} or \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame}) object containing data either in the form of \code{FilteredData} or as a list of \code{data.frame}. When passing a list of non-reactive \code{data.frame} objects, they are converted to reactive \code{data.frame}s internally. When passing a list of reactive or non-reactive \code{data.frame} objects, the argument \code{join_keys} is required also.} diff --git a/man/data_extract_spec.Rd b/man/data_extract_spec.Rd index 128f2328..173abe67 100644 --- a/man/data_extract_spec.Rd +++ b/man/data_extract_spec.Rd @@ -7,20 +7,20 @@ data_extract_spec(dataname, select = NULL, filter = NULL, reshape = FALSE) } \arguments{ -\item{dataname}{(\code{character})\cr +\item{dataname}{(\code{character}) The name of the dataset to be extracted.} -\item{select}{(\code{NULL}, \code{select_spec}-S3 class or \code{delayed_select_spec})\cr +\item{select}{(\code{NULL}, \code{select_spec}-S3 class or \code{delayed_select_spec}) Columns to be selected from the input dataset mentioned in \code{dataname}. The setup can be created using \link{select_spec} function.} -\item{filter}{(\code{NULL} or \code{filter_spec} or its respective delayed version)\cr +\item{filter}{(\code{NULL} or \code{filter_spec} or its respective delayed version) Setup of the filtering of key columns inside the dataset. This setup can be created using the \link{filter_spec} function. Please note that if both select and filter are set to NULL, then the result will be a filter spec UI with all variables as possible choices and a select spec with multiple set to \code{TRUE}.} -\item{reshape}{(\code{logical})\cr +\item{reshape}{(\code{logical}) whether reshape long to wide. Note that it will be used only in case of long dataset with multiple keys selected in filter part.} } @@ -35,10 +35,8 @@ Note that no checks based on columns can be done because the data is only referr } \section{Module Development}{ -\describe{ \code{teal.transform} uses this object to construct a UI element in a module. } -} \examples{ adtte_filters <- filter_spec( diff --git a/man/data_extract_srv.Rd b/man/data_extract_srv.Rd index 9205291d..ad4fcdfa 100644 --- a/man/data_extract_srv.Rd +++ b/man/data_extract_srv.Rd @@ -31,12 +31,12 @@ data_extract_srv(id, datasets, data_extract_spec, ...) \item{id}{An ID string that corresponds with the ID used to call the module's UI function.} -\item{datasets}{(\code{FilteredData} or \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame})\cr +\item{datasets}{(\code{FilteredData} or \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame}) object containing data either in the form of \code{FilteredData} or as a list of \code{data.frame}. When passing a list of non-reactive \code{data.frame} objects, they are converted to reactive \code{data.frame}s internally. When passing a list of reactive or non-reactive \code{data.frame} objects, the argument \code{join_keys} is required also.} -\item{data_extract_spec}{(\code{data_extract_spec} or a list of \code{data_extract_spec})\cr +\item{data_extract_spec}{(\code{data_extract_spec} or a list of \code{data_extract_spec}) A list of data filter and select information constructed by \link{data_extract_spec}.} \item{...}{an additional argument \code{join_keys} is required when \code{datasets} is a list of \code{data.frame}. @@ -59,20 +59,20 @@ If \code{NULL} then no validation will be added. See example for more details.} } \value{ A reactive \code{list} containing following fields: - \itemize{ -\item{\code{filters}: }{A list with the information on the filters that are applied to the data set.} -\item{\code{select}: }{The variables that are selected from the dataset.} -\item{\code{always_selected}: }{The column names from the data set that should always be selected.} -\item{\code{reshape}: }{Whether reshape long to wide should be applied or not.} -\item{\code{dataname}: }{The name of the data set.} -\item{\code{internal_id}: }{The \code{id} of the corresponding shiny input element.} -\item{\code{keys}: }{The names of the columns that can be used to merge the data set.} -\item{\code{iv}:}{A \code{shinyvalidate::InputValidator} containing \code{validator} for this \code{data_extract}} +\item \code{filters}: A list with the information on the filters that are applied to the data set. +\item \code{select}: The variables that are selected from the dataset. +\item \code{always_selected}: The column names from the data set that should always be selected. +\item \code{reshape}: Whether reshape long to wide should be applied or not. +\item \code{dataname}: The name of the data set. +\item \code{internal_id}: The \code{id} of the corresponding shiny input element. +\item \code{keys}: The names of the columns that can be used to merge the data set. +\item \code{iv}: A \code{shinyvalidate::InputValidator} containing \code{validator} for this \code{data_extract} } } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}} + Extracting details of the selection(s) in \link{data_extract_ui} elements. } \examples{ diff --git a/man/data_extract_ui.Rd b/man/data_extract_ui.Rd index 4bf131a1..cc7a41d0 100644 --- a/man/data_extract_ui.Rd +++ b/man/data_extract_ui.Rd @@ -12,8 +12,7 @@ data_extract_ui(id, label, data_extract_spec, is_single_dataset = FALSE) \item{label}{(\code{character}) Label above the data extract input} \item{data_extract_spec}{(\code{list} of \code{data_extract_spec}) -This is the outcome of listing \link{data_extract_spec} -constructor calls.} +This is the outcome of listing \code{\link[=data_extract_spec]{data_extract_spec()}} constructor calls.} \item{is_single_dataset}{(\code{logical}) FALSE to display the dataset widget} } @@ -23,28 +22,25 @@ a specific dataset. The input elements will be returned inside a \link[shiny:ree There are three inputs that will be rendered \enumerate{ -\item{Dataset select}{ Optional. If more than one \link{data_extract_spec} is handed over +\item Dataset select Optional. If more than one \link{data_extract_spec} is handed over to the function, a shiny \link[shiny:selectInput]{shiny::selectInput} will be rendered. Else just the name of the dataset is given. -} -\item{Filter Panel }{Optional. If the \link{data_extract_spec} contains a +\item Filter Panel Optional. If the \link{data_extract_spec} contains a filter element a shiny \link[shiny:selectInput]{shiny::selectInput} will be rendered with the options to filter the dataset. -} -\item{Select panel }{A shiny \link[shiny:selectInput]{shiny::selectInput} to select columns from the dataset to +\item Select panel A shiny \link[shiny:selectInput]{shiny::selectInput} to select columns from the dataset to go into the analysis. } -} The output can be analyzed using \code{data_extract_srv(...)}. } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} This functionality should be used in the encoding panel of your \code{teal} app. -It will allow app-developers to specify a \link{data_extract_spec} object. +It will allow app-developers to specify a \code{\link[=data_extract_spec]{data_extract_spec()}} object. This object should be used to \code{teal} module variables being filtered data from \code{CDISC} datasets. You can use this function in the same way as any -\href{https://shiny.rstudio.com/articles/modules.html}{shiny module} UI. +\href{https://shiny.rstudio.com/articles/modules.html}{\verb{shiny module}} UI. The corresponding server module can be found in \code{\link[=data_extract_srv]{data_extract_srv()}}. } \examples{ diff --git a/man/filter_spec.Rd b/man/filter_spec.Rd index 9ac68b44..9833e841 100644 --- a/man/filter_spec.Rd +++ b/man/filter_spec.Rd @@ -45,7 +45,7 @@ This value will be displayed inside the shiny app upon start. The \code{all_choi object indicates selecting all possible choices.} \item{multiple}{(\code{logical}) Whether multiple values shall be allowed in the -shiny \code{\link[shiny]{selectInput}}.} +shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}.} \item{label}{optional (\code{character}). Define a label on top of this specific shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}. The default value is \code{"Filter by"}.} diff --git a/man/filter_spec_internal.Rd b/man/filter_spec_internal.Rd index d3d8a347..7a1cb511 100644 --- a/man/filter_spec_internal.Rd +++ b/man/filter_spec_internal.Rd @@ -104,7 +104,7 @@ shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}. The default value i if true allow to change the initially selected values of the variables; otherwise, do not allow.} \item{multiple}{(\code{logical}) Whether multiple values shall be allowed in the -shiny \code{\link[shiny]{selectInput}}.} +shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}.} \item{sep}{(\code{character}) A separator string to split the \code{choices} or \code{selected} inputs into the values of the different columns} diff --git a/man/get_anl_relabel_call.Rd b/man/get_anl_relabel_call.Rd index 2db5e0a9..4169553b 100644 --- a/man/get_anl_relabel_call.Rd +++ b/man/get_anl_relabel_call.Rd @@ -7,14 +7,15 @@ get_anl_relabel_call(columns_source, datasets, anl_name = "ANL") } \arguments{ -\item{columns_source}{\code{named list}\cr +\item{columns_source}{named \code{list} where names are column names, values are labels + additional attribute \code{dataname}} -\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame})\cr -object containing data as a list of \code{data.frame}. When passing a list of non-reactive \code{data.frame} objects, they are -converted to reactive \code{data.frame} objects internally.} +\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame}) +object containing data as a list of \code{data.frame}. When passing a list of +non-reactive \code{data.frame} objects, they are converted to reactive +\code{data.frame} objects internally.} -\item{anl_name}{(\code{character(1)})\cr +\item{anl_name}{(\code{character(1)}) Name of the analysis dataset.} } \value{ diff --git a/man/get_dataset_prefixed_col_names.Rd b/man/get_dataset_prefixed_col_names.Rd index d22376d7..af80ac10 100644 --- a/man/get_dataset_prefixed_col_names.Rd +++ b/man/get_dataset_prefixed_col_names.Rd @@ -17,5 +17,5 @@ A named character vector with the non-key columns of the \code{data}. \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}} } \references{ -\link{data_extract_srv} +\code{\link[=data_extract_srv]{data_extract_srv()}} } diff --git a/man/get_dplyr_call.Rd b/man/get_dplyr_call.Rd index 9569ee16..6ced133b 100644 --- a/man/get_dplyr_call.Rd +++ b/man/get_dplyr_call.Rd @@ -13,9 +13,11 @@ get_dplyr_call( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{idx}{optional (\code{integer}) current selector index in all selectors list} diff --git a/man/get_dplyr_call_data.Rd b/man/get_dplyr_call_data.Rd index f85b831d..d0b9e7f7 100644 --- a/man/get_dplyr_call_data.Rd +++ b/man/get_dplyr_call_data.Rd @@ -7,9 +7,11 @@ get_dplyr_call_data(selector_list, join_keys = teal.data::join_keys()) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{join_keys}{(\code{join_keys}) nested list of keys used for joining} diff --git a/man/get_filter_call.Rd b/man/get_filter_call.Rd index 57d50f4f..e861bee1 100644 --- a/man/get_filter_call.Rd +++ b/man/get_filter_call.Rd @@ -11,7 +11,7 @@ get_filter_call(filter, dataname = NULL, datasets = NULL) \item{dataname}{(\code{NULL} or \code{character}) name of dataset.} -\item{datasets}{(\code{NULL} or \code{named `list`}).} +\item{datasets}{(\code{NULL} or named \code{list}).} } \value{ (\code{call}) \code{dplyr} filter call diff --git a/man/get_merge_call.Rd b/man/get_merge_call.Rd index c1138832..66c91159 100644 --- a/man/get_merge_call.Rd +++ b/man/get_merge_call.Rd @@ -13,20 +13,22 @@ get_merge_call( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{join_keys}{(\code{join_keys}) nested list of keys used for joining} \item{dplyr_call_data}{(\code{list}) simplified selectors with aggregated set of filters,} -\item{merge_function}{(\code{character(1)} or \code{reactive})\cr +\item{merge_function}{(\code{character(1)} or \code{reactive}) A character string of a function that accepts the arguments \code{x}, \code{y} and \code{by} to perform the merging of datasets.} -\item{anl_name}{(\code{character(1)})\cr +\item{anl_name}{(\code{character(1)}) Name of the analysis dataset.} } \value{ diff --git a/man/get_merge_key_grid.Rd b/man/get_merge_key_grid.Rd index 075ebd33..e80266fa 100644 --- a/man/get_merge_key_grid.Rd +++ b/man/get_merge_key_grid.Rd @@ -7,9 +7,11 @@ get_merge_key_grid(selector_list, join_keys = teal.data::join_keys()) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{join_keys}{(\code{join_keys}) nested list of keys used for joining} diff --git a/man/get_merge_key_i.Rd b/man/get_merge_key_i.Rd index 50102d8b..3750cc63 100644 --- a/man/get_merge_key_i.Rd +++ b/man/get_merge_key_i.Rd @@ -11,9 +11,11 @@ get_merge_key_i( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{idx}{optional (\code{integer}) current selector index in all selectors list} diff --git a/man/get_merge_key_pair.Rd b/man/get_merge_key_pair.Rd index efa3f046..2e6c45d7 100644 --- a/man/get_merge_key_pair.Rd +++ b/man/get_merge_key_pair.Rd @@ -22,15 +22,13 @@ Gets keys vector from keys list \details{ This function covers up to now 4 cases \itemize{ -\item{dataset without parent }{ Primary keys are returned} -\item{dataset source = dataset target}{ -The primary keys subtracted of all key columns that -get purely filtered. This means just one value would -be left after filtering inside this column. Then it -can be taken out. -} -\item{target \code{dataname} is parent }{ foreign keys} -\item{any other case }{foreign keys} +\item dataset without parent: Primary keys are returned +\item dataset source = dataset target: +The primary keys subtracted of all key columns that get purely filtered. +This means just one value would be left after filtering inside this column. +Then it can be taken out. +\item target \code{dataname} is parent foreign keys +\item any other case foreign keys } } \keyword{internal} diff --git a/man/get_relabel_call.Rd b/man/get_relabel_call.Rd index e6359f27..df54f82c 100644 --- a/man/get_relabel_call.Rd +++ b/man/get_relabel_call.Rd @@ -7,7 +7,7 @@ get_relabel_call(labels) } \arguments{ -\item{labels}{(\verb{named character})\cr +\item{labels}{(\verb{named character}) where name is name is function argument name and value is a function argument value.} } \value{ @@ -15,6 +15,7 @@ where name is name is function argument name and value is a function argument va } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}} + Function creates relabel call from named character. } \examples{ diff --git a/man/get_rename_call.Rd b/man/get_rename_call.Rd index c40ef0f6..2161cb38 100644 --- a/man/get_rename_call.Rd +++ b/man/get_rename_call.Rd @@ -12,9 +12,11 @@ get_rename_call( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{idx}{optional (\code{integer}) current selector index in all selectors list} diff --git a/man/get_reshape_call.Rd b/man/get_reshape_call.Rd index 027cd34f..5c9d581a 100644 --- a/man/get_reshape_call.Rd +++ b/man/get_reshape_call.Rd @@ -12,9 +12,11 @@ get_reshape_call( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{idx}{optional (\code{integer}) current selector index in all selectors list} diff --git a/man/merge_datasets.Rd b/man/merge_datasets.Rd index 70c8bf4c..7c88987f 100644 --- a/man/merge_datasets.Rd +++ b/man/merge_datasets.Rd @@ -13,24 +13,27 @@ merge_datasets( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} -\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame})\cr -object containing data as a list of \code{data.frame}. When passing a list of non-reactive \code{data.frame} objects, they are -converted to reactive \code{data.frame} objects internally.} +\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame}) +object containing data as a list of \code{data.frame}. When passing a list of +non-reactive \code{data.frame} objects, they are converted to reactive +\code{data.frame} objects internally.} -\item{join_keys}{(\code{join_keys})\cr +\item{join_keys}{(\code{join_keys}) of variables used as join keys for each of the datasets in \code{datasets}. This will be used to extract the \code{keys} of every dataset.} -\item{merge_function}{(\code{character(1)} or \code{reactive})\cr +\item{merge_function}{(\code{character(1)} or \code{reactive}) A character string of a function that accepts the arguments \code{x}, \code{y} and \code{by} to perform the merging of datasets.} -\item{anl_name}{(\code{character(1)})\cr +\item{anl_name}{(\code{character(1)}) Name of the analysis dataset.} } \value{ diff --git a/man/merge_expression_module.Rd b/man/merge_expression_module.Rd index 34c13e90..62a165dd 100644 --- a/man/merge_expression_module.Rd +++ b/man/merge_expression_module.Rd @@ -34,21 +34,22 @@ merge_expression_module( ) } \arguments{ -\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame})\cr -object containing data as a list of \code{data.frame}. When passing a list of non-reactive \code{data.frame} objects, they are +\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame}) +object containing data as a list of \code{data.frame}. +When passing a list of non-reactive \code{data.frame} objects, they are converted to reactive \code{data.frame} objects internally.} -\item{join_keys}{(\code{join_keys})\cr +\item{join_keys}{(\code{join_keys}) of variables used as join keys for each of the datasets in \code{datasets}. This will be used to extract the \code{keys} of every dataset.} -\item{data_extract}{(named \code{list} of \code{data_extract_spec})\cr} +\item{data_extract}{(named \code{list} of \code{data_extract_spec})} -\item{merge_function}{(\code{character(1)})\cr -A character string of a function that -accepts the arguments \code{x}, \code{y} and \code{by} to perform the merging of datasets.} +\item{merge_function}{(\code{character(1)}) +A character string of a function that accepts the arguments \code{x}, \code{y} and +\code{by} to perform the merging of datasets.} -\item{anl_name}{(\code{character(1)})\cr +\item{anl_name}{(\code{character(1)}) Name of the analysis dataset.} \item{id}{An ID string that corresponds with the ID used to call the module's diff --git a/man/merge_expression_srv.Rd b/man/merge_expression_srv.Rd index 2b689383..6140f59f 100644 --- a/man/merge_expression_srv.Rd +++ b/man/merge_expression_srv.Rd @@ -37,24 +37,27 @@ merge_expression_srv( \item{id}{An ID string that corresponds with the ID used to call the module's UI function.} -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} -\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame})\cr -object containing data as a list of \code{data.frame}. When passing a list of non-reactive \code{data.frame} objects, they are -converted to reactive \code{data.frame} objects internally.} +\item{datasets}{(named \code{list} of \code{reactive} or non-\code{reactive} \code{data.frame}) +object containing data as a list of \code{data.frame}. When passing a list of +non-reactive \code{data.frame} objects, they are converted to reactive +\code{data.frame} objects internally.} -\item{join_keys}{(\code{join_keys})\cr +\item{join_keys}{(\code{join_keys}) of variables used as join keys for each of the datasets in \code{datasets}. This will be used to extract the \code{keys} of every dataset.} -\item{merge_function}{(\code{character(1)} or \code{reactive})\cr +\item{merge_function}{(\code{character(1)} or \code{reactive}) A character string of a function that accepts the arguments \code{x}, \code{y} and \code{by} to perform the merging of datasets.} -\item{anl_name}{(\code{character(1)})\cr +\item{anl_name}{(\code{character(1)}) Name of the analysis dataset.} } \value{ @@ -64,8 +67,9 @@ reactive expression with output from \code{\link[=merge_datasets]{merge_datasets \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} } \details{ -When additional processing of the \code{data_extract} list input is required, \code{merge_expression_srv()} can be -combined with \code{data_extract_multiple_srv()} or \code{data_extract_srv()} to influence the \code{selector_list} input. +When additional processing of the \code{data_extract} list input is required, +\code{merge_expression_srv()} can be combined with \code{data_extract_multiple_srv()} +or \code{data_extract_srv()} to influence the \code{selector_list} input. Compare the example below with that found in \code{\link[=merge_expression_module]{merge_expression_module()}}. } \examples{ diff --git a/man/merge_selectors.Rd b/man/merge_selectors.Rd index b899800e..f1e86511 100644 --- a/man/merge_selectors.Rd +++ b/man/merge_selectors.Rd @@ -7,9 +7,11 @@ merge_selectors(selector_list) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} } \value{ diff --git a/man/parse_merge_key_i.Rd b/man/parse_merge_key_i.Rd index 1e86d23c..a9f99959 100644 --- a/man/parse_merge_key_i.Rd +++ b/man/parse_merge_key_i.Rd @@ -12,9 +12,11 @@ parse_merge_key_i( ) } \arguments{ -\item{selector_list}{(\code{reactive})\cr -output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. -When using a reactive named list, the names must be identical to the shiny ids of the respective +\item{selector_list}{(\code{reactive}) +output from \code{\link[=data_extract_multiple_srv]{data_extract_multiple_srv()}} or a reactive named list of +outputs from \code{\link[=data_extract_srv]{data_extract_srv()}}. +When using a reactive named list, the names must be identical to the shiny +ids of the respective \code{\link[=data_extract_ui]{data_extract_ui()}}.} \item{idx}{optional (\code{integer}) current selector index in all selectors list} diff --git a/man/select_spec.Rd b/man/select_spec.Rd index e1eaae60..042d7522 100644 --- a/man/select_spec.Rd +++ b/man/select_spec.Rd @@ -39,19 +39,19 @@ select_spec.default( \arguments{ \item{choices}{(\code{character}) or (\code{delayed_data}) object. Named character vector to define the choices -of a shiny \code{\link[shiny]{selectInput}}. These have to be columns in the -dataset defined in the \code{\link{data_extract_spec}} where this is called. -\code{delayed_data} objects can be created via \code{\link{variable_choices}} or \code{\link{value_choices}}.} +of a shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}. These have to be columns in the +dataset defined in the \code{\link[=data_extract_spec]{data_extract_spec()}} where this is called. +\code{delayed_data} objects can be created via \code{\link[=variable_choices]{variable_choices()}} or \code{\link[=value_choices]{value_choices()}}.} \item{selected}{optional (\code{character} or \code{NULL} or \code{all_choices} or \code{delayed_data} object). -Named character vector to define the selected values of a shiny \code{\link[shiny]{selectInput}}. +Named character vector to define the selected values of a shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}. Passing an \code{all_choices()} object indicates selecting all possible choices. Defaults to the first value of \code{choices} or \code{NULL} for delayed data loading.} \item{multiple}{(\code{logical}) Whether multiple values shall be allowed in the -shiny \code{\link[shiny]{selectInput}}.} +shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}.} -\item{fixed}{optional (\code{logical}). \code{\link{data_extract_spec}} specific feature to +\item{fixed}{optional (\code{logical}). \code{\link[=data_extract_spec]{data_extract_spec()}} specific feature to hide the choices selected in case they are not needed. Setting fixed to \code{TRUE} will not allow the user to select columns. It will then lead to a selection of columns in the dataset that is defined by the developer of the app.} @@ -62,7 +62,7 @@ always be selected} \item{ordered}{(\code{logical(1)}) Flags whether selection order should be tracked.} \item{label}{optional (\code{character}). Define a label on top of this specific -shiny \code{\link[shiny]{selectInput}}. The default value is \code{"Select"}.} +shiny \code{\link[shiny:selectInput]{shiny::selectInput()}}. The default value is \code{"Select"}.} } \value{ A \code{select_spec}-S3 class object or \code{delayed_select_spec}-S3-class object. @@ -71,7 +71,7 @@ If \code{select_spec}, then the function double checks the \code{choices} and \c } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}} -\code{select_spec} is used inside \code{teal} to create a \code{\link[shiny]{selectInput}} +\code{select_spec} is used inside \code{teal} to create a \code{\link[shiny:selectInput]{shiny::selectInput()}} that will select columns from a dataset. } \examples{ diff --git a/tests/testthat/setup-skip_if_too_deep.R b/tests/testthat/setup-skip_if_too_deep.R index 7e707f6a..954dd280 100644 --- a/tests/testthat/setup-skip_if_too_deep.R +++ b/tests/testthat/setup-skip_if_too_deep.R @@ -1,6 +1,7 @@ #' Returns testing depth set by an environmental variable. #' -#' @details Looks for the option `TESTING_DEPTH` first, if not set, +#' @details +#' Looks for the option `TESTING_DEPTH` first, if not set, #' takes the system environmental variable `TESTING_DEPTH`. If neither #' is set, then returns 3 by default. If the value of `TESTING_DEPTH` #' is not a scalar numeric, then returns 3. @@ -23,26 +24,33 @@ testing_depth <- function() { # nolint # nousage } #' Skipping tests in the testthat pipeline under specific scope -#' @description This function should be used per each \code{testthat::test_that} call. -#' Each of the call should specify an appropriate depth value. -#' The depth value will set the appropriate scope so more/less time consuming tests could be recognized. -#' The environment variable \code{TESTING_DEPTH} is used for changing the scope of \code{testthat} pipeline. -#' \code{TESTING_DEPTH} interpretation for each possible value: -#' \itemize{ -#' \item{0}{no tests at all} -#' \item{1}{fast - small scope - executed on every commit} -#' \item{3}{medium - medium scope - daily integration pipeline} -#' \item{5}{slow - all tests - daily package tests} -#' } -#' @param depth \code{numeric} the depth of the testing evaluation, -#' has opposite interpretation to environment variable \code{TESTING_DEPTH}. -#' So e.g. `0` means run it always and `5` means a heavy test which should be run rarely. -#' If the \code{depth} argument is larger than \code{TESTING_DEPTH} then the test is skipped. +#' +#' @description +#' This function should be used per each [testthat::test_that()] call. +#' Each of the call should specify an appropriate depth value. +#' The depth value will set the appropriate scope so more/less time consuming tests could be recognized. +#' The environment variable `TESTING_DEPTH` is used for changing the scope of `testthat` pipeline. +#' +#' `TESTING_DEPTH` interpretation for each possible value: +#' +#' 1. no tests at all +#' 2. fast - small scope - executed on every commit +#' 3. medium - medium scope - daily integration pipeline +#' 4. slow - all tests - daily package tests +#' +#' @param depth `numeric` the depth of the testing evaluation, +#' has opposite interpretation to environment variable `TESTING_DEPTH`. +#' So e.g. `0` means run it always and `5` means a heavy test which should be run rarely. +#' If the `depth` argument is larger than `TESTING_DEPTH` then the test is skipped. +#' +#' @return `NULL` or invoke an error produced by `testthat::skip` +#' #' @importFrom testthat skip -#' @return \code{NULL} or invoke an error produced by \code{testthat::skip} -#' @note By default \code{TESTING_DEPTH} is equal to 3 if there is no environment variable for it. -#' By default \code{depth} argument lower or equal to 3 will not be skipped because by default \code{TESTING_DEPTH} -#' is equal to 3. To skip <= 3 depth tests then the environment variable has to be lower than 3 respectively. +#' +#' @note By default `TESTING_DEPTH` is equal to 3 if there is no environment variable for it. +#' By default `depth` argument lower or equal to 3 will not be skipped because by default `TESTING_DEPTH` +#' is equal to 3. +#' To skip <= 3 depth tests then the environment variable has to be lower than 3 respectively. skip_if_too_deep <- function(depth) { # nolintr checkmate::assert_number(depth, lower = 0, upper = 5) test_to_depth <- testing_depth() # by default 3 if there are no env variable