Skip to content

Commit

Permalink
move @Usage in ?teal_slice(s) after description
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Mar 5, 2024
1 parent 0eadcef commit f4cf7b9
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 60 deletions.
63 changes: 32 additions & 31 deletions R/teal_slice.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
#'
#' Create a `teal_slice` object that holds complete information on filtering one variable.
#'
# Custom @usage section is needed to that utility functions are listed in the usage and they do not have index entries.
#' @usage
#' teal_slice(
#' dataname,
#' varname,
#' id,
#' expr,
#' choices = NULL,
#' selected = NULL,
#' keep_na = NULL,
#' keep_inf = NULL,
#' fixed = FALSE,
#' anchored = FALSE,
#' multiple = TRUE,
#' title = NULL,
#' ...
#' )
#'
#' is.teal_slice(x)
#'
#' as.teal_slice(x)
#'
#' ## S3 method for class 'teal_slice'
#' as.list.teal_slice(x, ...)
#'
#' ## S3 method for class 'teal_slice'
#' format.teal_slice(x, show_all = FALSE, trim_lines = TRUE, ...)
#'
#' ## S3 method for class 'teal_slice'
#' print.teal_slice(x, ...)
#'
#' @details
#' `teal_slice` object fully describes filter state and can be used to create,
#' modify, and delete a filter state. A `teal_slice` contains a number of common fields
#' (all named arguments of `teal_slice`), some of which are mandatory, but only
Expand Down Expand Up @@ -110,37 +142,6 @@
#'
#' @seealso [`teal_slices`]
#'
# Custom @usage section is needed to that utility functions are listed in the usage and they do not have index entries.
#' @usage
#' teal_slice(
#' dataname,
#' varname,
#' id,
#' expr,
#' choices = NULL,
#' selected = NULL,
#' keep_na = NULL,
#' keep_inf = NULL,
#' fixed = FALSE,
#' anchored = FALSE,
#' multiple = TRUE,
#' title = NULL,
#' ...
#' )
#'
#' is.teal_slice(x)
#'
#' as.teal_slice(x)
#'
#' ## S3 method for class 'teal_slice'
#' as.list.teal_slice(x, ...)
#'
#' ## S3 method for class 'teal_slice'
#' format.teal_slice(x, show_all = FALSE, trim_lines = TRUE, ...)
#'
#' ## S3 method for class 'teal_slice'
#' print.teal_slice(x, ...)
#'
#' @export
teal_slice <- function(dataname, # When editing function parameters, please remember to update @usage section.
varname,
Expand Down
59 changes: 30 additions & 29 deletions R/teal_slices.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@
#'
#' Create `teal_slices` object to package multiple filters and additional settings.
#'
# Custom @usage section is needed to that utility functions are listed in the usage and they do not have index entries.
#' @usage
#' teal_slices(
#' ...,
#' exclude_varnames = NULL,
#' include_varnames = NULL,
#' count_type = NULL,
#' allow_add = TRUE
#' )
#'
#' is.teal_slices(x)
#'
#' as.teal_slices(x)
#'
#' ## S3 method for class 'teal_slices'
#' as.list(x, recursive = FALSE, ...)
#'
#' ## S3 method for class 'teal_slices'
#' x[i]
#'
#' ## S3 method for class 'teal_slices'
#' c(...)
#'
#' ## S3 method for class 'teal_slices'
#' format(x, show_all = FALSE, trim_lines = TRUE, ...)
#'
#' ## S3 method for class 'teal_slices'
#' print(x, ...)
#'
#' @details
#' `teal_slices()` collates multiple `teal_slice` objects into a `teal_slices` object,
#' a complete filter specification. This is used by all classes above `FilterState`
#' as well as `filter_panel_api` wrapper functions.
Expand Down Expand Up @@ -88,35 +118,6 @@
#' - [`teal_slice`] for creating constituent elements of `teal_slices`
#' - [`teal::slices_store`] for robust utilities for saving and loading `teal_slices` in `JSON` format
#'
# Custom @usage section is needed to that utility functions are listed in the usage and they do not have index entries.
#' @usage
#' teal_slices(
#' ...,
#' exclude_varnames = NULL,
#' include_varnames = NULL,
#' count_type = NULL,
#' allow_add = TRUE
#' )
#'
#' is.teal_slices(x)
#'
#' as.teal_slices(x)
#'
#' ## S3 method for class 'teal_slices'
#' as.list(x, recursive = FALSE, ...)
#'
#' ## S3 method for class 'teal_slices'
#' x[i]
#'
#' ## S3 method for class 'teal_slices'
#' c(...)
#'
#' ## S3 method for class 'teal_slices'
#' format(x, show_all = FALSE, trim_lines = TRUE, ...)
#'
#' ## S3 method for class 'teal_slices'
#' print(x, ...)
#'
#' @export
#'
teal_slices <- function(..., # When editing function parameters, please remember to update @usage section.
Expand Down

0 comments on commit f4cf7b9

Please sign in to comment.