I'm writing a package with an S4 class, and I've written methods for as.POSIXct
and as.POSIXlt
for the class. I've written the documentation and everything looks fine, except that I would like to reference 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 that is only supposed to be put in the \usage
section, which isn't where I want it. Is there a way to do this? It seems odd to me that it would not be allowed.
I realize that it is possible to combine these .rd files and avoid this issue, but I'm trying to learn as much as possible about classes and packages in R, so this is of interest to me 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 line fourth from the bottom is the one that is causing problems.