Hi,
I have written a package that contains many s4 generic functions and
associated methods. I am having a lot of trouble getting R to build the help
pages for these generic functions without reporting, "missing link(s):
~~fun~~, which means that it cannot find the appropriate function when code
in the example section of the help is run. Right?
After some playing around I can get it to build the help without missing a
link, but often I am not sure what I have done to correct the "problem" and
it takes a lot of time.
For instance, I had the package build the help without missing a function
link. I then added a argument to two different functions and updated the
corresponding .rd help files and now when R build the help pages it reports
"missing link(s): ~~fun~~. What is going on?
Below is the code from the help file and the associated s4 method.
Any help would be greatly appreciated.
Steve
GENERIC FUNCTION AND METHODS
setGeneric("getRemovedDf.OAD",function(x,y,z,simplify=TRUE,descrip=FALSE){st
andardGeneric("getRemovedDf.OAD")})
setMethod("getRemovedDf.OAD","status.or.rm.v1",
function(x,y,z,simplify,descrip){
if(length(0">[EMAIL PROTECTED]) <mailto:[EMAIL PROTECTED])> >0){
pred <- unlist(lapply([EMAIL PROTECTED],function(x)x[1]))
resp <- unlist(lapply([EMAIL PROTECTED],function(x)x[2]))
out <- data.frame(pred,resp)
names(out) <- c(y,z)
return(out)
} else {
return(data.frame())
}
}
)
setMethod("getRemovedDf.OAD","sa",
function(x,y,z,simplify,descrip){
i <- unlist(lapply([EMAIL PROTECTED],function(x)length([EMAIL
PROTECTED])))
if(all(i==0)){
return(list())
} else {
if(simplify) [EMAIL PROTECTED](along=i)[i==0]]
<mailto:[EMAIL PROTECTED](along=i)[i==0]]<-NULL> <-NULL
tmp <-
lapply([EMAIL PROTECTED],getRemovedDf.OAD,[EMAIL PROTECTED],[EMAIL PROTECTED])
if(descrip){
f <- as.data.frame(descrip[!"history"%in%names([EMAIL
PROTECTED])])
return(lapply(tmp,function(x)cbind(f,x)))
} else {
return(tmp)
}
}
}
)
MAN FILE
\name{getRemovedDf.OAD}
\alias{getRemovedDf.OAD}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{ ~~function to do ... ~~ }
\description{
~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
getRemovedDf.OAD(x, y, z, simplify = TRUE, descrip=FALSE)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{x}{ ~~Describe \code{x} here~~ }
\item{y}{ ~~Describe \code{y} here~~ }
\item{z}{ ~~Describe \code{z} here~~ }
\item{simplify}{ ~~Describe \code{simplify} here~~ }
\item{descrip}{ ~~Describe \code{descrip} here~~ }
}
\details{
~~ If necessary, more details than the __description__ above ~~
}
\value{
~Describe the value returned
If it is a LIST, use
\item{comp1 }{Description of 'comp1'}
\item{comp2 }{Description of 'comp2'}
...
}
\references{ ~put references to the literature/web site here ~ }
\author{ ~~who you are~~ }
\note{ ~~further notes~~ }
~Make other sections like Warning with \section{Warning }{....} ~
\seealso{ ~~objects to See Also as \code{\link{~~fun~~}}, ~~~ }
\examples{
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(x,y,z,simplify=TRUE,descrip=FALSE){standardGeneric("getRemovedDf.OA
D")}
}
\keyword{ ~kwd1 }% at least one, from doc/KEYWORDS
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html