[Rd] Rd error message

Terry Therneau therneau at mayo.edu
Fri Dec 16 23:12:47 CET 2011

I get the following error from one of my Rd files in R CMD check (R

* checking Rd files ... WARNING
Error in switch(attr(block, "Rd_tag"), TEXT = if (!grepl("^[[:space:]]*
$",  : 
  EXPR must be a length 1 vector

problem found in ‘backsolve.Rd’

This is likely something that will be glaringly obvious once it's
pointed out, but without a line number I can't seem to find it. I've
been counting braces but don't see a mismatch.

FYI, the file is below. (It is modeled on chol.Rd from the Matrix

Terry Therneau

\title{Solve an Upper or Lower Triangular System}
  Solves a system of linear equations where the coefficient matrix is
  upper (or \sQuote{right}, \sQuote{R}) or lower (\sQuote{left},
  \sQuote{L}) triangular.\cr 

  \code{x <- backsolve(R, b)} solves \eqn{R x = b}.
  backsolve(r, \dots)
  \S4method{backsolve}{gchol}(r, x, k=ncol(r), upper.tri=TRUE, \dots)
  \S4method{backsolve}{gchol.bdsmatrix}(r, x, k=ncol(r), upper.tri=TRUE,
  \item{r}{a matrix or matrix-like object}
  \item{x}{a vector or a matrix whose columns give the right-hand sides
    the equations.}
  \item{k}{The number of columns of \code{r} and rows of \code{x} to
  \item{upper.tri}{logical; if \code{TRUE} (default), the \emph{upper}
    \emph{tri}angular part of \code{r} is used.  Otherwise, the lower
  \item{\dots}{further arguments passed to other methods}
  Use \code{\link{showMethods}(backsolve)} to see all the defined
    the two created by the bdsmatrix library are described here:
      \item{bdsmatrix}{\code{signature=(r= "gchol")} for a generalized
	cholesky decomposition}
      \item{bdsmatrix}{\code{signature=(r= "gchol.bdsmatrix")} for the
	generalize cholesky decomposition of a bdsmatrix object}
  The solution of the triangular system.  The result will be a vector if
  \code{x} is a vector and a matrix if \code{x} is a matrix.

  Note that \code{forwardsolve(L, b)} is just a wrapper for
  \code{backsolve(L, b, upper.tri=FALSE)}.
  The generalized Cholesky decompostion of a symmetric matrix A is
  \eqn{A = LDL'}{A= LD t(L)} where D is diagonal, L is lower triangular,
  and \eqn{L'}{t(L)} is the transpose of L.
  These functions solve either \eqn{L\sqrt{D} x =b}{L sqrt(D) x=b}
  (when \code{upper.tri=FALSE}) or \eqn{\sqrt{D}L' x=b}{sqrt(D) t(L)
  The \code{bdsmatrix} package promotes the base R \code{backsolve}
  function to a
  To see the full documentation for the default method, view
  from the \code{base} package.
\code{\link{forwardsolve}}, \code{\link{gchol}}
\keyword{ array }
\keyword{ algebra }

More information about the R-devel mailing list