From 6368086108fe449e9351f507e59322200788f5fa Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 4 Mar 2024 14:41:12 +0100 Subject: [PATCH 01/10] custom usage section for teal_slice --- R/teal_slice.R | 37 ++++++++++++++++++++++++++++++------- man/teal_slice.Rd | 15 ++++++--------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index 1c65284eb..d30f977bc 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -110,6 +110,36 @@ #' #' @seealso [`teal_slices`] #' +#' @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(show_all = FALSE, trim_lines = TRUE, ...) +#' +#' # S3 method for class 'teal_slice' +#' print.teal_slice(x, ...) +#' #' @export teal_slice <- function(dataname, varname, @@ -172,7 +202,6 @@ teal_slice <- function(dataname, ans } -#' @rdname teal_slice #' @export #' @keywords internal #' @@ -180,7 +209,6 @@ is.teal_slice <- function(x) { # nolint inherits(x, "teal_slice") } -#' @rdname teal_slice #' @export #' @keywords internal #' @@ -189,7 +217,6 @@ as.teal_slice <- function(x) { # nolint do.call(teal_slice, x) } -#' @rdname teal_slice #' @export #' @keywords internal #' @@ -208,8 +235,6 @@ as.list.teal_slice <- function(x, ...) { x[c(formal_args, extra_args)] } - -#' @rdname teal_slice #' @export #' @keywords internal #' @@ -223,7 +248,6 @@ format.teal_slice <- function(x, show_all = FALSE, trim_lines = TRUE, ...) { jsonify(x_list, trim_lines) } -#' @rdname teal_slice #' @export #' @keywords internal #' @@ -231,7 +255,6 @@ print.teal_slice <- function(x, ...) { cat(format(x, ...)) } - # format utils ----- #' Convert a list to a justified `JSON` string diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 36fcb0196..315ae3091 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -2,11 +2,6 @@ % Please edit documentation in R/teal_slice.R \name{teal_slice} \alias{teal_slice} -\alias{is.teal_slice} -\alias{as.teal_slice} -\alias{as.list.teal_slice} -\alias{format.teal_slice} -\alias{print.teal_slice} \title{Specify single filter} \usage{ teal_slice( @@ -29,11 +24,14 @@ is.teal_slice(x) as.teal_slice(x) -\method{as.list}{teal_slice}(x, ...) +# S3 method for class 'teal_slice' +as.list.teal_slice(x, ...) -\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) +# S3 method for class 'teal_slice' +format.teal_slice(show_all = FALSE, trim_lines = TRUE, ...) -\method{print}{teal_slice}(x, ...) +# S3 method for class 'teal_slice' +print.teal_slice(x, ...) } \arguments{ \item{dataname}{(\code{character(1)}) name of data set} @@ -171,4 +169,3 @@ print(x1, show_all = TRUE, trim_lines = FALSE) \seealso{ \code{\link{teal_slices}} } -\keyword{internal} From e6ac92c499fe62d0cb8a8684e2713a440e5200fa Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 4 Mar 2024 15:52:30 +0100 Subject: [PATCH 02/10] bring teal_slices to INDEX --- R/teal_slice.R | 9 +++++---- R/teal_slices.R | 44 ++++++++++++++++++++++++++++++-------------- man/teal_slice.Rd | 6 +++--- man/teal_slices.Rd | 29 +++++++++++------------------ 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index d30f977bc..c79d23502 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -110,6 +110,7 @@ #' #' @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, @@ -131,17 +132,17 @@ #' #' as.teal_slice(x) #' -#' # S3 method for class 'teal_slice' +#' ## S3 method for class 'teal_slice' #' as.list.teal_slice(x, ...) #' -#' # S3 method for class 'teal_slice' +#' ## S3 method for class 'teal_slice' #' format.teal_slice(show_all = FALSE, trim_lines = TRUE, ...) #' -#' # S3 method for class 'teal_slice' +#' ## S3 method for class 'teal_slice' #' print.teal_slice(x, ...) #' #' @export -teal_slice <- function(dataname, +teal_slice <- function(dataname, # When editing function parameters, please remember to update @usage section. varname, id, expr, diff --git a/R/teal_slices.R b/R/teal_slices.R index 7fb9161c0..de1f072d6 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -86,9 +86,38 @@ #' - [`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(..., +teal_slices <- function(..., # When editing function parameters, please remember to update @usage section. exclude_varnames = NULL, include_varnames = NULL, count_type = NULL, @@ -126,8 +155,6 @@ teal_slices <- function(..., ) } - -#' @rdname teal_slices #' @export #' @keywords internal #' @@ -135,8 +162,6 @@ is.teal_slices <- function(x) { # nolint inherits(x, "teal_slices") } - -#' @rdname teal_slices #' @export #' @keywords internal #' @@ -149,8 +174,6 @@ as.teal_slices <- function(x) { # nolint do.call(teal_slices, c(ans, attrs)) } - -#' @rdname teal_slices #' @export #' @keywords internal #' @@ -160,8 +183,6 @@ as.list.teal_slices <- function(x, recursive = FALSE, ...) { # nolint ans } - -#' @rdname teal_slices #' @export #' @keywords internal #' @@ -184,8 +205,6 @@ as.list.teal_slices <- function(x, recursive = FALSE, ...) { # nolint y } - -#' @rdname teal_slices #' @export #' @keywords internal #' @@ -206,8 +225,6 @@ c.teal_slices <- function(...) { ) } - -#' @rdname teal_slices #' @param show_all (`logical(1)`) whether to display non-null elements of constituent `teal_slice` objects #' @param trim_lines (`logical(1)`) whether to trim lines #' @export @@ -228,7 +245,6 @@ format.teal_slices <- function(x, show_all = FALSE, trim_lines = TRUE, ...) { jsonify(slices_list, trim_lines) } -#' @rdname teal_slices #' @export #' @keywords internal #' diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 315ae3091..29ca20c0c 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -24,13 +24,13 @@ is.teal_slice(x) as.teal_slice(x) -# S3 method for class 'teal_slice' +## S3 method for class 'teal_slice' as.list.teal_slice(x, ...) -# S3 method for class 'teal_slice' +## S3 method for class 'teal_slice' format.teal_slice(show_all = FALSE, trim_lines = TRUE, ...) -# S3 method for class 'teal_slice' +## S3 method for class 'teal_slice' print.teal_slice(x, ...) } \arguments{ diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd index 0e931d40b..2ea45e952 100644 --- a/man/teal_slices.Rd +++ b/man/teal_slices.Rd @@ -2,13 +2,6 @@ % Please edit documentation in R/teal_slices.R \name{teal_slices} \alias{teal_slices} -\alias{is.teal_slices} -\alias{as.teal_slices} -\alias{as.list.teal_slices} -\alias{[.teal_slices} -\alias{c.teal_slices} -\alias{format.teal_slices} -\alias{print.teal_slices} \title{Complete filter specification} \usage{ teal_slices( @@ -23,15 +16,20 @@ is.teal_slices(x) as.teal_slices(x) -\method{as.list}{teal_slices}(x, recursive = FALSE, ...) +## S3 method for class 'teal_slices' +as.list(x, recursive = FALSE, ...) -\method{[}{teal_slices}(x, i) +## S3 method for class 'teal_slices' +x[i] -\method{c}{teal_slices}(...) +## S3 method for class 'teal_slices' +c(...) -\method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) +## S3 method for class 'teal_slices' +format(x, show_all = FALSE, trim_lines = TRUE, ...) -\method{print}{teal_slices}(x, ...) +## S3 method for class 'teal_slices' +print(x, ...) } \arguments{ \item{...}{any number of \code{teal_slice} objects. For \code{print} and \code{format}, @@ -58,13 +56,9 @@ Please make sure that adding new filters doesn't fail on target platform before \item{x}{object to test for \code{teal_slices}, object to convert to \code{teal_slices} or a \code{teal_slices} object} -\item{recursive}{(\code{logical(1)}) flag specifying whether to also convert to list the elements of this \code{teal_slices}} - \item{i}{(\code{character} or \code{numeric} or \code{logical}) indicating which elements to extract} -\item{show_all}{(\code{logical(1)}) whether to display non-null elements of constituent \code{teal_slice} objects} - -\item{trim_lines}{(\code{logical(1)}) whether to trim lines} +\item{recursive}{(\code{logical(1)}) flag specifying whether to also convert to list the elements of this \code{teal_slices}} } \value{ \code{teal_slices}, which is an unnamed list of \code{teal_slice} objects. @@ -137,4 +131,3 @@ print(all_filters, trim_lines = FALSE) \item \code{\link[teal:slices_store]{teal::slices_store}} for robust utilities for saving and loading \code{teal_slices} in \code{JSON} format } } -\keyword{internal} From a7070ef5e9ba46ff687b48573b475b19b432a3de Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 4 Mar 2024 15:55:23 +0100 Subject: [PATCH 03/10] missing parameter in usage for format.teal_slice --- R/teal_slice.R | 2 +- man/teal_slice.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index c79d23502..84afe167d 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -136,7 +136,7 @@ #' as.list.teal_slice(x, ...) #' #' ## S3 method for class 'teal_slice' -#' format.teal_slice(show_all = FALSE, trim_lines = TRUE, ...) +#' format.teal_slice(x, show_all = FALSE, trim_lines = TRUE, ...) #' #' ## S3 method for class 'teal_slice' #' print.teal_slice(x, ...) diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 29ca20c0c..33e8265bc 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -28,7 +28,7 @@ as.teal_slice(x) as.list.teal_slice(x, ...) ## S3 method for class 'teal_slice' -format.teal_slice(show_all = FALSE, trim_lines = TRUE, ...) +format.teal_slice(x, show_all = FALSE, trim_lines = TRUE, ...) ## S3 method for class 'teal_slice' print.teal_slice(x, ...) From 0eadcef4c5366e82e33c65aca361fcaa288c2e06 Mon Sep 17 00:00:00 2001 From: m7pr Date: Mon, 4 Mar 2024 16:01:04 +0100 Subject: [PATCH 04/10] document parameters for format in teal_slices --- R/teal_slices.R | 12 ++++++------ man/teal_slices.Rd | 12 ++++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/R/teal_slices.R b/R/teal_slices.R index de1f072d6..44d06655a 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -27,10 +27,12 @@ #' - `"all"` to have counts of single `FilterState` to show number of observation in filtered #' and unfiltered dataset. Note, that issues were reported when using this option with `MultiAssayExperiment`. #' Please make sure that adding new filters doesn't fail on target platform before deploying for production. -#' @param allow_add (`logical(1)`) logical flag specifying whether the user will be able to add new filters -#' @param x object to test for `teal_slices`, object to convert to `teal_slices` or a `teal_slices` object -#' @param i (`character` or `numeric` or `logical`) indicating which elements to extract -#' @param recursive (`logical(1)`) flag specifying whether to also convert to list the elements of this `teal_slices` +#' @param allow_add (`logical(1)`) logical flag specifying whether the user will be able to add new filters. +#' @param x object to test for `teal_slices`, object to convert to `teal_slices` or a `teal_slices` object. +#' @param i (`character` or `numeric` or `logical`) indicating which elements to extract. +#' @param recursive (`logical(1)`) flag specifying whether to also convert to list the elements of this `teal_slices`. +#' @param show_all (`logical(1)`) whether to display non-null elements of constituent `teal_slice` objects. +#' @param trim_lines (`logical(1)`) whether to trim lines. #' #' @return #' `teal_slices`, which is an unnamed list of `teal_slice` objects. @@ -225,8 +227,6 @@ c.teal_slices <- function(...) { ) } -#' @param show_all (`logical(1)`) whether to display non-null elements of constituent `teal_slice` objects -#' @param trim_lines (`logical(1)`) whether to trim lines #' @export #' @keywords internal #' diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd index 2ea45e952..b9f23b85e 100644 --- a/man/teal_slices.Rd +++ b/man/teal_slices.Rd @@ -52,13 +52,17 @@ and unfiltered dataset. Note, that issues were reported when using this option w Please make sure that adding new filters doesn't fail on target platform before deploying for production. }} -\item{allow_add}{(\code{logical(1)}) logical flag specifying whether the user will be able to add new filters} +\item{allow_add}{(\code{logical(1)}) logical flag specifying whether the user will be able to add new filters.} -\item{x}{object to test for \code{teal_slices}, object to convert to \code{teal_slices} or a \code{teal_slices} object} +\item{x}{object to test for \code{teal_slices}, object to convert to \code{teal_slices} or a \code{teal_slices} object.} -\item{i}{(\code{character} or \code{numeric} or \code{logical}) indicating which elements to extract} +\item{i}{(\code{character} or \code{numeric} or \code{logical}) indicating which elements to extract.} -\item{recursive}{(\code{logical(1)}) flag specifying whether to also convert to list the elements of this \code{teal_slices}} +\item{recursive}{(\code{logical(1)}) flag specifying whether to also convert to list the elements of this \code{teal_slices}.} + +\item{show_all}{(\code{logical(1)}) whether to display non-null elements of constituent \code{teal_slice} objects.} + +\item{trim_lines}{(\code{logical(1)}) whether to trim lines.} } \value{ \code{teal_slices}, which is an unnamed list of \code{teal_slice} objects. From f4cf7b9e9d7ad485540112b8be065173e07f8328 Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 5 Mar 2024 12:20:59 +0100 Subject: [PATCH 05/10] move @usage in ?teal_slice(s) after description --- R/teal_slice.R | 63 +++++++++++++++++++++++++------------------------ R/teal_slices.R | 59 ++++++++++++++++++++++----------------------- 2 files changed, 62 insertions(+), 60 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index 84afe167d..e87682b66 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -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 @@ -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, diff --git a/R/teal_slices.R b/R/teal_slices.R index 44d06655a..ebfc344a2 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -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. @@ -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. From 8b446da9b0008e4db3ebeec1c567e9bcaf2977f2 Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 5 Mar 2024 12:39:58 +0100 Subject: [PATCH 06/10] add aliases and remove object names from S3 classes in usage --- R/teal_slice.R | 8 +++++--- R/teal_slices.R | 2 ++ man/teal_slice.Rd | 11 ++++++++--- man/teal_slices.Rd | 6 ++++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index e87682b66..2341f83f0 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -25,13 +25,13 @@ #' as.teal_slice(x) #' #' ## S3 method for class 'teal_slice' -#' as.list.teal_slice(x, ...) +#' as.list(x, ...) #' #' ## S3 method for class 'teal_slice' -#' format.teal_slice(x, show_all = FALSE, trim_lines = TRUE, ...) +#' format(x, show_all = FALSE, trim_lines = TRUE, ...) #' #' ## S3 method for class 'teal_slice' -#' print.teal_slice(x, ...) +#' print(x, ...) #' #' @details #' `teal_slice` object fully describes filter state and can be used to create, @@ -142,6 +142,8 @@ #' #' @seealso [`teal_slices`] #' +#' @aliases is.teal_slice as.teal_slice as.list.teal_slice format.teal_slice print.teal_slice +#' #' @export teal_slice <- function(dataname, # When editing function parameters, please remember to update @usage section. varname, diff --git a/R/teal_slices.R b/R/teal_slices.R index ebfc344a2..36b74ee37 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -118,6 +118,8 @@ #' - [`teal_slice`] for creating constituent elements of `teal_slices` #' - [`teal::slices_store`] for robust utilities for saving and loading `teal_slices` in `JSON` format #' +#' @aliases is.teal_slices as.teal_slices as.list.teal_slices format.teal_slices print.teal_slices c.teal_slices +#' #' @export #' teal_slices <- function(..., # When editing function parameters, please remember to update @usage section. diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 33e8265bc..7a8f3f270 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -2,6 +2,11 @@ % Please edit documentation in R/teal_slice.R \name{teal_slice} \alias{teal_slice} +\alias{is.teal_slice} +\alias{as.teal_slice} +\alias{as.list.teal_slice} +\alias{format.teal_slice} +\alias{print.teal_slice} \title{Specify single filter} \usage{ teal_slice( @@ -25,13 +30,13 @@ is.teal_slice(x) as.teal_slice(x) ## S3 method for class 'teal_slice' -as.list.teal_slice(x, ...) +as.list(x, ...) ## S3 method for class 'teal_slice' -format.teal_slice(x, show_all = FALSE, trim_lines = TRUE, ...) +format(x, show_all = FALSE, trim_lines = TRUE, ...) ## S3 method for class 'teal_slice' -print.teal_slice(x, ...) +print(x, ...) } \arguments{ \item{dataname}{(\code{character(1)}) name of data set} diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd index b9f23b85e..7a02f59a8 100644 --- a/man/teal_slices.Rd +++ b/man/teal_slices.Rd @@ -2,6 +2,12 @@ % Please edit documentation in R/teal_slices.R \name{teal_slices} \alias{teal_slices} +\alias{is.teal_slices} +\alias{as.teal_slices} +\alias{as.list.teal_slices} +\alias{format.teal_slices} +\alias{print.teal_slices} +\alias{c.teal_slices} \title{Complete filter specification} \usage{ teal_slices( From da30e47e3b0ee7c414a1aeea751b317b47722cbc Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 5 Mar 2024 12:58:27 +0100 Subject: [PATCH 07/10] change the way methods are specified in @usage for teal_slice(s) --- R/teal_slice.R | 9 +++------ R/teal_slices.R | 12 ++++-------- man/teal_slice.Rd | 9 +++------ man/teal_slices.Rd | 12 ++++-------- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index 2341f83f0..7ab996835 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -24,14 +24,11 @@ #' #' as.teal_slice(x) #' -#' ## S3 method for class 'teal_slice' -#' as.list(x, ...) +#' \\method{as.list}{teal_slice}(x, ...) #' -#' ## S3 method for class 'teal_slice' -#' format(x, show_all = FALSE, trim_lines = TRUE, ...) +#' \\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) #' -#' ## S3 method for class 'teal_slice' -#' print(x, ...) +#' \\methods{print}{teal_slice}(x, ...) #' #' @details #' `teal_slice` object fully describes filter state and can be used to create, diff --git a/R/teal_slices.R b/R/teal_slices.R index 36b74ee37..403216d69 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -16,20 +16,16 @@ #' #' as.teal_slices(x) #' -#' ## S3 method for class 'teal_slices' -#' as.list(x, recursive = FALSE, ...) +#' \\method{as.list}{teal_slices}(x, recursive = FALSE, ...) #' #' ## S3 method for class 'teal_slices' #' x[i] #' -#' ## S3 method for class 'teal_slices' -#' c(...) +#' \\method{c}{teal_slices}(...) #' -#' ## S3 method for class 'teal_slices' -#' format(x, show_all = FALSE, trim_lines = TRUE, ...) +#' \\method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) #' -#' ## S3 method for class 'teal_slices' -#' print(x, ...) +#' \\method{print}{teal_slices}(x, ...) #' #' @details #' `teal_slices()` collates multiple `teal_slice` objects into a `teal_slices` object, diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 7a8f3f270..7eaf471ec 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -29,14 +29,11 @@ is.teal_slice(x) as.teal_slice(x) -## S3 method for class 'teal_slice' -as.list(x, ...) +\\method{as.list}{teal_slice}(x, ...) -## S3 method for class 'teal_slice' -format(x, show_all = FALSE, trim_lines = TRUE, ...) +\\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) -## S3 method for class 'teal_slice' -print(x, ...) +\\methods{print}{teal_slice}(x, ...) } \arguments{ \item{dataname}{(\code{character(1)}) name of data set} diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd index 7a02f59a8..0e2d77971 100644 --- a/man/teal_slices.Rd +++ b/man/teal_slices.Rd @@ -22,20 +22,16 @@ is.teal_slices(x) as.teal_slices(x) -## S3 method for class 'teal_slices' -as.list(x, recursive = FALSE, ...) +\\method{as.list}{teal_slices}(x, recursive = FALSE, ...) ## S3 method for class 'teal_slices' x[i] -## S3 method for class 'teal_slices' -c(...) +\\method{c}{teal_slices}(...) -## S3 method for class 'teal_slices' -format(x, show_all = FALSE, trim_lines = TRUE, ...) +\\method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) -## S3 method for class 'teal_slices' -print(x, ...) +\\method{print}{teal_slices}(x, ...) } \arguments{ \item{...}{any number of \code{teal_slice} objects. For \code{print} and \code{format}, From 04f350bc36cfae6eedd4b0d1dd898e46be4cfbe8 Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 5 Mar 2024 13:00:37 +0100 Subject: [PATCH 08/10] typo --- R/teal_slice.R | 2 +- man/teal_slice.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index 7ab996835..bed695191 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -28,7 +28,7 @@ #' #' \\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) #' -#' \\methods{print}{teal_slice}(x, ...) +#' \\method{print}{teal_slice}(x, ...) #' #' @details #' `teal_slice` object fully describes filter state and can be used to create, diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index 7eaf471ec..c85bb277e 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -33,7 +33,7 @@ as.teal_slice(x) \\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) -\\methods{print}{teal_slice}(x, ...) +\\method{print}{teal_slice}(x, ...) } \arguments{ \item{dataname}{(\code{character(1)}) name of data set} From 64ba691b4456d91bab6e595514a5d98cfe18da9b Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 5 Mar 2024 13:13:32 +0100 Subject: [PATCH 09/10] finalize [.teal_slices custom @usage --- R/teal_slices.R | 4 ++-- man/teal_slices.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/teal_slices.R b/R/teal_slices.R index 403216d69..e65ccc30b 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -18,8 +18,7 @@ #' #' \\method{as.list}{teal_slices}(x, recursive = FALSE, ...) #' -#' ## S3 method for class 'teal_slices' -#' x[i] +#' \\method{[}{teal_slices}(x, i) #' #' \\method{c}{teal_slices}(...) #' @@ -115,6 +114,7 @@ #' - [`teal::slices_store`] for robust utilities for saving and loading `teal_slices` in `JSON` format #' #' @aliases is.teal_slices as.teal_slices as.list.teal_slices format.teal_slices print.teal_slices c.teal_slices +#' [.teal_slices #' #' @export #' diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd index 0e2d77971..f7a16fc3e 100644 --- a/man/teal_slices.Rd +++ b/man/teal_slices.Rd @@ -8,6 +8,7 @@ \alias{format.teal_slices} \alias{print.teal_slices} \alias{c.teal_slices} +\alias{[.teal_slices} \title{Complete filter specification} \usage{ teal_slices( @@ -24,8 +25,7 @@ as.teal_slices(x) \\method{as.list}{teal_slices}(x, recursive = FALSE, ...) -## S3 method for class 'teal_slices' -x[i] +\\method{[}{teal_slices}(x, i) \\method{c}{teal_slices}(...) From 526da56a569dfb37d70b80495b6226210e3925bb Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 5 Mar 2024 14:05:31 +0100 Subject: [PATCH 10/10] unnecessary \ in \methods in @usage of teal_slice(s) --- R/teal_slice.R | 6 +++--- R/teal_slices.R | 10 +++++----- man/teal_slice.Rd | 6 +++--- man/teal_slices.Rd | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/R/teal_slice.R b/R/teal_slice.R index bed695191..655ccf9ba 100644 --- a/R/teal_slice.R +++ b/R/teal_slice.R @@ -24,11 +24,11 @@ #' #' as.teal_slice(x) #' -#' \\method{as.list}{teal_slice}(x, ...) +#' \method{as.list}{teal_slice}(x, ...) #' -#' \\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) +#' \method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) #' -#' \\method{print}{teal_slice}(x, ...) +#' \method{print}{teal_slice}(x, ...) #' #' @details #' `teal_slice` object fully describes filter state and can be used to create, diff --git a/R/teal_slices.R b/R/teal_slices.R index e65ccc30b..8a4b53b92 100644 --- a/R/teal_slices.R +++ b/R/teal_slices.R @@ -16,15 +16,15 @@ #' #' as.teal_slices(x) #' -#' \\method{as.list}{teal_slices}(x, recursive = FALSE, ...) +#' \method{as.list}{teal_slices}(x, recursive = FALSE, ...) #' -#' \\method{[}{teal_slices}(x, i) +#' \method{[}{teal_slices}(x, i) #' -#' \\method{c}{teal_slices}(...) +#' \method{c}{teal_slices}(...) #' -#' \\method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) +#' \method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) #' -#' \\method{print}{teal_slices}(x, ...) +#' \method{print}{teal_slices}(x, ...) #' #' @details #' `teal_slices()` collates multiple `teal_slice` objects into a `teal_slices` object, diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd index c85bb277e..7dcefefe8 100644 --- a/man/teal_slice.Rd +++ b/man/teal_slice.Rd @@ -29,11 +29,11 @@ is.teal_slice(x) as.teal_slice(x) -\\method{as.list}{teal_slice}(x, ...) +\method{as.list}{teal_slice}(x, ...) -\\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) +\method{format}{teal_slice}(x, show_all = FALSE, trim_lines = TRUE, ...) -\\method{print}{teal_slice}(x, ...) +\method{print}{teal_slice}(x, ...) } \arguments{ \item{dataname}{(\code{character(1)}) name of data set} diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd index f7a16fc3e..062e50191 100644 --- a/man/teal_slices.Rd +++ b/man/teal_slices.Rd @@ -23,15 +23,15 @@ is.teal_slices(x) as.teal_slices(x) -\\method{as.list}{teal_slices}(x, recursive = FALSE, ...) +\method{as.list}{teal_slices}(x, recursive = FALSE, ...) -\\method{[}{teal_slices}(x, i) +\method{[}{teal_slices}(x, i) -\\method{c}{teal_slices}(...) +\method{c}{teal_slices}(...) -\\method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) +\method{format}{teal_slices}(x, show_all = FALSE, trim_lines = TRUE, ...) -\\method{print}{teal_slices}(x, ...) +\method{print}{teal_slices}(x, ...) } \arguments{ \item{...}{any number of \code{teal_slice} objects. For \code{print} and \code{format},