Skip to content

Complicated doc names for S7 methods dispatching on S7::class_any #1871

@mitchelloharawild

Description

@mitchelloharawild

The method documentation name and alias for S7::class_any is not human friendly. For example, the Documenting S7 vignette produces \alias{size,structure(list(), class = "S7_any")-method} when documenting the method as a separate Rd.

MRE:

#' Size of an object
#'
#' @description
#' `size()` determines the size of an object.
#'
#' # Methods
#' `size()` is an S7 generic with methods available for the following
#' classes:
#'
#' `r doclisting::methods_list("size")`
#'
#' @param x An object.
#' @param ... Not used.
#' @returns A single number.
#' 
#' @export
size <- S7::new_generic("size", "x")

#' @inherit size
S7::method(size, S7::class_any) <- function(x, ...) {
  length(x)
}

A short abbreviation like any-method similar what is done for S7 base types (e.g. S7::class_double produces \alias{size,double-method}) would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions