Skip to content

list automatically all s3 methods + individual s3 method documentations #1513

@MaximilianPi

Description

@MaximilianPi

Hi @hadley, hi roxygen2 developer team,

It would be very useful for users to see the associated methods listed in a S3 function constructor, and at the same time have the individual documentation for the methods. Of course, this can be done manually, but for large packages it becomes messy at some point.

So, is there a way to automatically list all methods of a s3 class in the documentation and at the same time provide individual documentation for the methods?

@DescribeIn solves the first problem, but then suppresses individual documentation for the methods:

#' MyClass
#'
#'
#' @export
MyClass <- function() {
  out = list()
  class(out) = "MyClass"
}


#' Print class citodnn
#'
#' @param x a model created by MyClass
#' @param ... additional arguments
#' @describeIn MyClass print method
#' @export
print.MyClass <- function(x,...){
  return("MyClass")
}

The print method is listed in the MyClass documentation, but there is no independent documentation for print.Myclass anymore. The descriptions are also mixed.

Thanks for your help,
Max

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementrd ✍️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions