Skip to content

Support setAs() and setGroupGeneric() - #1909

Merged
hadley merged 1 commit into
mainfrom
document-setas
Jul 27, 2026
Merged

Support setAs() and setGroupGeneric()#1909
hadley merged 1 commit into
mainfrom
document-setas

Conversation

@hadley

@hadley hadley commented Jul 27, 2026

Copy link
Copy Markdown
Member

roxygen2 didn't recognise setAs() or setGroupGeneric(), so a roxygen block in front of either produced an Rd file with no \usage — which current R-devel reports as Rd files without \usage. setAs() also got no method alias. Both now behave like setMethod() and setGeneric():

\name{coerce,numeric,Account-method}
\alias{coerce,numeric,Account-method}
\usage{
\S4method{coerce}{numeric,Account}(from, to = "Account", strict = TRUE)
}

Fixes #1908

🤖 Generated with Claude Code

Both were unrecognised by object_from_call(), so a roxygen block in front
of either produced an Rd file with no \usage and, for setAs(), no method
alias. R-devel now NOTEs this as "Rd files without \usage".

setAs() defines a method for coerce(), so it maps to an s4method object;
setGroupGeneric() creates a generic, so parser_setGeneric() works as is.

Fixes #1908
@hadley
hadley merged commit 735f2b2 into main Jul 27, 2026
13 checks passed
@hadley
hadley deleted the document-setas branch July 27, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

documenting setAs() methods

1 participant