Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/all_choices.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' `r lifecycle::badge("experimental")`
#'
#' An S3 structure representing the selection of all possible choices in a
#' `filter_spec`, `select_spec` or `choices_selected` object
#' `filter_spec`, `select_spec` or `choices_selected` object.
#'
#' @return `all_choices` object.
#'
Expand Down
24 changes: 13 additions & 11 deletions R/call_utils.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Checks `varname` argument and convert to call
#'
#' Checks `varname` type and parse if it's a `character`
#' Checks `varname` type and parse if it's a `character`.
#'
#' @param varname (`name` or `call` or `character(1)`)
#' name of the variable
Expand Down Expand Up @@ -35,22 +35,24 @@ call_check_parse_varname <- function(varname) {
#'
#' Compose choices condition call from inputs.
#'
#' @param varname (`name` or `call` or `character(1)`)
#' name of the variable.
#' @param choices (`vector`)
#' `varname` values to match using the `==` (single value) or `%in%` (vector)
#' condition.
#' @details
#' `choices` can be vector of any type but for some output might be converted:
#' * `factor` call is composed on choices converted to `character`;
#' * `Date` call is composed on choices converted to `character` using
#' `format(choices)`;
#' * `POSIXct`, `POSIXlt` Call is composed on choices converted to `character` using
#' * `POSIXct`, `POSIXlt` call is composed on choices converted to `character` using
#' `format(choices)`.
#'
#' One has to be careful here as formatted date-time variable might loose
#' some precision (see `format` argument in [format.POSIXlt()] and output call
#' could be insufficient for exact comparison. In this case one should specify
#' `varname = trunc(<varname>)` and possibly convert `choices` to `character`).
#' One has to be careful here as formatted date-time variable might loose
#' some precision (see `format` argument in [format.POSIXlt()] and output call
#' could be insufficient for exact comparison. In this case one should specify
#' `varname = trunc(<varname>)` and possibly convert `choices` to `character`).
#'
#' @param varname (`name` or `call` or `character(1)`)
#' name of the variable.
#' @param choices (`vector`)
#' `varname` values to match using the `==` (single value) or `%in%` (vector)
#' condition.
#'
#' @return `call`.
#'
Expand Down
17 changes: 8 additions & 9 deletions R/choices_labeled.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ choices_labeled <- function(choices, labels, subset = NULL, types = NULL) {
)
}

#' Wrapper on [choices_labeled] to label variables basing on existing labels in data
#' Variable label extraction and custom selection from data
#'
#' @description
#' `r lifecycle::badge("stable")`
#'
#' Wrapper on [choices_labeled] to label variables basing on existing labels in data.
#'
#' @rdname variable_choices
#'
Expand Down Expand Up @@ -240,10 +242,13 @@ variable_choices.data.frame <- function(data, subset = NULL, fill = TRUE, key =
}
}

#' Wrapper on [choices_labeled] to label variable values basing on other variable values
#' Value labeling and filtering based on variable relationship
#'
#' @description
#' `r lifecycle::badge("stable")`
#'
#' Wrapper on [choices_labeled] to label variable values basing on other variable values.
#'
#' @rdname value_choices
#'
#' @param data (`data.frame`, `character`)
Expand Down Expand Up @@ -374,17 +379,11 @@ value_choices.data.frame <- function(data,
res
}

#' Print choices_labeled object
#'
#' `r lifecycle::badge("stable")`
#'
#' @rdname choices_labeled
#' @describeIn choices_labeled Print choices_labeled object
#'
#' @param x an object used to select a method.
#' @param ... further arguments passed to or from other methods.
#'
#' @return `x`, invisibly.
#'
#' @export
#'
print.choices_labeled <- function(x, ...) {
Expand Down
11 changes: 7 additions & 4 deletions R/choices_selected.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ no_select_keyword <- "-- no selection --"
#' additional settings such as to order the choices with the selected elements appearing first
#' or whether to block the user from making selections.
#'
#' Can be used in `ui` input elements such as [teal.widgets::optionalSelectInput()].
#' Can be used in UI input elements such as [teal.widgets::optionalSelectInput()].
#'
#' @details
#' Please note that the order of selected will always follow the order of choices. The `keep_order`
Expand All @@ -34,8 +34,8 @@ no_select_keyword <- "-- no selection --"
#' be on top of the drop-down field.
#' @param fixed (optional `logical`) Whether to block user to select choices.
#'
#' @return `choices_selected` returns object of class `choices_selected` and of
#' type list which contains the specified `choices`, `selected`, `keep_order` and `fixed`.
#' @return `choices_selected` returns list of `choices_selected`, encapsulating the specified
#' `choices`, `selected`, `keep_order` and `fixed`.
#'
#' @examples
#' library(shiny)
Expand Down Expand Up @@ -240,7 +240,10 @@ no_selected_as_NULL <- function(x) { # nolint: object_name_linter.
}

## Non-exported utils functions ----
## Modify vectors and keep attributes
#' Modify vectors and keep attributes
#' @keywords internal
#' @noRd
#'
vector_reorder <- function(vec, idx) {
checkmate::assert_atomic(vec)
checkmate::assert_integer(idx, min.len = 1, lower = 1, any.missing = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#' @name rADSL
"rADSL"

#' Random Time to Event Analysis Dataset
#' Random time to event analysis dataset
#'
#' @docType data
#'
Expand Down
11 changes: 7 additions & 4 deletions R/data_extract_datanames.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @param data_extracts (`list`) of data extracts for single variable.
#'
#' @return [shiny::helpText()] object.
#' @return `shiny.tag` defining help-text element that can be added to a UI element.
#'
#' @export
#'
Expand All @@ -26,7 +26,7 @@ datanames_input <- function(data_extracts) {
#' `r lifecycle::badge("stable")`
#'
#' Fetches `dataname` slot per `data_extract_spec` from a list of
#' `data_extract_spec` and returns the unique `dataname` set.
#' `data_extract_spec`.
#'
#' @param data_extracts (`data_extract_spec(1)`) object or a list (of lists)
#' of `data_extract_spec`.
Expand Down Expand Up @@ -64,9 +64,12 @@ get_extract_datanames <- function(data_extracts) {
unique(unlist(datanames))
}

#' Checks if the input `data_extract_spec` objects all come from the same dataset
#' Verify uniform dataset source across data extract specification
#'
#' `r lifecycle::badge("stable")`
#' @description
#' `r lifecycle::badge("stable")`
#'
#' Checks if the input `data_extract_spec` objects all come from the same dataset.
#'
#' @param ... either `data_extract_spec` objects or lists of `data_extract_spec`
#' objects that do not contain `NULL`
Expand Down
2 changes: 1 addition & 1 deletion R/data_extract_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ data_extract_srv.list <- function(id,
#'
#' See example for details.
#'
#' @return reactive named list containing outputs from [data_extract_srv()].
#' @return reactive named `list` containing outputs from [data_extract_srv()].
#' Output list names are the same as `data_extract` input argument.
#'
#' @examples
Expand Down
8 changes: 4 additions & 4 deletions R/data_extract_spec.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Data Extract input for `teal` modules
#' Data extract input for `teal` modules
#'
#' @description
#' `r lifecycle::badge("stable")`
#'
#' The Data Extract input can be used to filter and select columns from a data set.
#' The Data extract input can be used to filter and select columns from a data set.
#' This function enables such an input in `teal`.
#' Please use the constructor function [data_extract_spec] to set it up.
#'
#' Note that no checks based on columns can be done because the data is only referred to by name.
#' @note No checks based on columns can be done because the data is only referred to by name.
#'
#' @rdname data_extract_spec
#'
Expand All @@ -22,7 +22,7 @@
#' @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
#' 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`)
Expand Down
2 changes: 1 addition & 1 deletion R/filter_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @description
#' `r lifecycle::badge("stable")`
#'
#' It consists in choices and additionally the variable names for the choices
#' It consists in choices and additionally the variable names for the choices.
#'
#' @details
#' The `filter_spec` is used inside `teal` apps to allow filtering datasets
Expand Down
4 changes: 2 additions & 2 deletions R/get_dplyr_call.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Aggregates data extract selectors
#'
#' Simplifies selector_list into aggregated list with one element per
#' same selector - same dataset, same filter configuration and same reshape status
#' Simplifies `selector_list` into aggregated list with one element per
#' same selector - same dataset, same filter configuration and same reshape status.
#'
#' @inheritParams get_merge_call
#'
Expand Down
2 changes: 1 addition & 1 deletion R/get_merge_call.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @description
#' `r lifecycle::badge("stable")`
#'
#' Returns list of calls depending on selector(s) and type of the merge.
#' Creates list of calls depending on selector(s) and type of the merge.
#' The merge order is the same as in selectors passed to the function.
#'
#' @inheritParams merge_datasets
Expand Down
4 changes: 2 additions & 2 deletions R/include_css_js.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#'
#' `system.file` should not be used to access files in other packages, it does
#' not work with `devtools`.
#' Therefore, we redefine this method in each package as needed.
#' Thus, we do not export this method
#' As a result, this method is individually redefined as required in each package.
#' Therefore, this function is not exported.
#'
#' @param pattern (`character`) pattern of files to be included.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/input_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ list_extract_spec <- function(x, allow_null = FALSE) {
#'
#' `r lifecycle::badge("stable")`
#'
#' Stops if condition not met
#' Stops if condition not met.
#'
#' @param extract_input (`list` or `NULL`) a list of `data_extract_spec`
#'
Expand Down
2 changes: 0 additions & 2 deletions R/merge_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ merge_datasets <- function(selector_list, datasets, join_keys, merge_function =
SIMPLIFY = FALSE
)

selector_datanames <- unique(vapply(merged_selector_list, `[[`, character(1), "dataname"))

dplyr_calls <- lapply(seq_along(merged_selector_list), function(idx) {
dplyr_call <- get_dplyr_call(
selector_list = merged_selector_list,
Expand Down
3 changes: 2 additions & 1 deletion R/merge_expression_module.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' Merge expression module
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' This function is a convenient wrapper to combine `data_extract_multiple_srv()` and
#' Convenient wrapper to combine `data_extract_multiple_srv()` and
#' `merge_expression_srv()` when no additional processing is required.
#' Compare the example below with that found in [merge_expression_srv()].
#'
Expand Down
2 changes: 1 addition & 1 deletion man/all_choices.Rd

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

2 changes: 1 addition & 1 deletion man/call_check_parse_varname.Rd

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

20 changes: 11 additions & 9 deletions man/call_condition_choice.Rd

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

2 changes: 1 addition & 1 deletion man/check_no_multiple_selection.Rd

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

7 changes: 5 additions & 2 deletions man/choices_labeled.Rd

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

6 changes: 3 additions & 3 deletions man/choices_selected.Rd

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

2 changes: 1 addition & 1 deletion man/data_extract_multiple_srv.Rd

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

Loading