From murdoch.duncan at gmail.com  Wed Mar 25 20:45:34 2015
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Wed, 25 Mar 2015 15:45:34 -0400
Subject: [Rd] vignette checking woes
In-Reply-To: <9D62BF42-5AB3-4600-A6F1-66C56426304D@illinois.edu>
References: <9D62BF42-5AB3-4600-A6F1-66C56426304D@illinois.edu>
Message-ID: <5513105E.8010806@gmail.com>

On 25/03/2015 2:59 PM, Roger Koenker wrote:
> I'm having trouble with R CMD check of my quantreg package.  All is well
> until I get to:
>
> checking running R code from vignettes ...
>     ?rq.Rnw? ... failed
>   ERROR
> Errors in running code in vignettes:
> when running code in ?rq.Rnw?
>
> when I see a snippet from the vignette code and then:
>
> Loading required namespace: MatrixModels
>
>    When sourcing ?rq.R?:
> Error: could not find function "sparse.model.matrix"
> Execution halted
>
> This is baffling to me since sparse.model.matrix is in the
> namespace of Matrix and it should be loaded at this stage
> since it is required by MatrixModels which has just been
> pronounced "loaded".
>
> I've verified that I can Sweave("rq.Rnw")
> and texi2pdf("rq.tex", clean=TRUE) without any problem.
>
> Any hints greatly appreciated, as always.
>

This could happen if you load the namespace of MatrixModels (e.g. by 
using :: notation), but don't put it on your search path (e.g. by using 
library(MatrixModels)).

When you run Sweave from within R, it sees the search path that was 
active when you called Sweave; when checking a vignette, it starts with 
a clean slate.

Duncan Murdoch



[Rd] vignette checking woes
Duncan Murdoch