I am writing a package with the S4 class, and I have written methods for as.POSIXct and as.POSIXlt for the class. I wrote the documentation and everything looks great, except that I would like to refer to the as.POSIXct method in the documentation for as.POSIXlt and vice versa. I tried \S4method{coerce}{abc, POSIXct}(from, to) , (where "abc" is the S4 class), but this should be placed in the \usage section, which is not where I want it. Is there any way to do this? It seems strange to me that this is not permissible.
I understand that you can combine these .rd files and avoid this problem, but I try to learn as much as possible about the classes and packages in R, so I'm interested in it anyway.
Here is the skeleton of one of the .Rd files:
\name{as.POSIXct-methods} \docType{methods} \alias{as.POSIXct-methods} \alias{as.POSIXct,ANY-method} \alias{as.POSIXct,abc-method} \title{\code{abc} Method for Function \code{as.POSIXct}} \description{ \code{as.POSIXct} method to coerce timestamps in \code{abc} objects into \code{POSIXct} format. } \section{Methods}{ \describe{ ~~description here~~ \item{\code{signature(x = "ANY")}}{ default implementation (from base) } \item{\code{signature(x = "abc")}}{ implementation for \code{\link{abc}} objects. ~~more description of function~~ See \code{\linkS4class{abc}} for more about abc objects. See also \code{\link[abc]{as.POSIXlt}} for the corresponding \code{POSIXlt} method. } }} \keyword{methods}
The fourth line from the bottom is the problem that causes the problems.
source share