From h.wickham at gmail.com  Wed Jun 30 15:32:58 2010
From: h.wickham at gmail.com (hadley wickham)
Date: Wed, 30 Jun 2010 08:32:58 -0500
Subject: [Rd] Tips for debugging: R CMD check examples
In-Reply-To: <1277884730.7384.4.camel@desktop.localdomain>
References: <1277884730.7384.4.camel@desktop.localdomain>
Message-ID: <AANLkTil6N-jeo4geAOPdjKPHWD0FIshNH5V5vkwiDA8s@mail.gmail.com>

> R CMD check produces a foo-Ex.R file where foo is the package name. You
> could start by sourcing that file in R --vanilla and see where it fails
> and also use standard debugging tools in R from there (i.e. drop into a
> debugger on error).

I knew about the foo-Ex.R file, but unfortunately running that
produced no errors. I ended up resorting to inserting print statements
every few lines to narrow down the exact location of the problem,
which revealed that my code assumed options(keep.source = TRUE) but
during R CMD check, options(keep.source = FALSE).

Hopefully this type of problem will be easier to sort out with the new
pure R R CMD check in 2.11.

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] Tips for debugging: R CMD check examples
hadley wickham