maxheld83 / pensieve

R package for the scientific study of human subjectivity.
https://www.maxheld.de/pensieve
GNU Affero General Public License v3.0
11 stars 2 forks source link

properly document s3 methods with multiple @describeIn #313

Open maxheld83 opened 7 years ago

maxheld83 commented 7 years ago

this currently does not work; importing broom::tidy() (the generic) blows up roxygen.

maxheld83 commented 7 years ago

blocked by https://github.com/klutometis/roxygen/issues/666

maxheld83 commented 6 years ago

nope actually, this was a special case in which it worked; still not working for functions and methods.

krlmlr commented 6 years ago

Is this about the following construct:

#' @describeIn where_to_describe Generic description
my_method <- function(...) UseMethod("my_method")

#' @describeIn where_to_describe Method description
my_method.some_class <- function(...) ...

?

maxheld83 commented 6 years ago

@krlmlr sorry about the late response; yes I think that's the same issue. I hope I have documented the feature request succinctly with an MWE in https://github.com/klutometis/roxygen/issues/666.

The issue is that it currently appears impossible to use minidesc with different types via @describeIn through roxygen, though the same thing is possible in plain *.Rd-markup, though it doesn't appear to be an R limitation.

Minimal construct might be below, where I want foo() (a generic), foo.class() (method), and bar() (some other function) to be all described in foo() with neat subsections by methods and by functions.

#' some function
foo <- function(...) UseMethod("foo")

#' describeIn foo fooing method for some class
foo.class <- function(...) ...

#' describeIn foo some other related function
bar <- function(...) ...

Does that make sense?

Sorry if I'm missing the obvious here.

Discussion should perhaps continue in https://github.com/klutometis/roxygen/issues/666; here's just my own note-to-self to update this in my package, if it is ever supported by roxygen.