Skip to content

@describeIn with plain functions does not include the function name. #285

@jimhester

Description

@jimhester
#' S1 documentation
s1 <- function(x) { }

#' @describeIn s1 a function a lot like s1, but different
s2 <- function(x) { x + 1 }

Generates this Rd

% Generated by roxygen2 (4.0.2): do not edit by hand
\name{s1}
\alias{s1}
\alias{s2}
\title{S1 documentation}
\usage{
s1(x)

s2(x)
}
\description{
S1 documentation
}
\section{Functions}{
\itemize{
\item \code{}: a function a lot like s1, but different
}}

Note the lack of anything in the \code{} block. I would expect this to be \code{s2} for this example.

This problematic code seems to be minidesc.R#L76, which calls default_name.default() which just returns NULL.

I think the correct solution would be to create a default_name.function which returns the function name. If you agree let me know and I can make a pull request.

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