[R] Sweave, cacheSweave, and data frame

Shige Song
2009-07-26T03:05:40Z

Dear All,

I have been using Sweave (mainly via the Sweave.sh script) and really like
it. I am working a paper (using Sweave, of course) which includes several
time-consuming computations, and it gets tedious to re-compile the whoel
thing every time I made changes. Then I discover the "cacheSweave"
package,
which seems the right solution to my problem. I only have on problem. Here
is what I did:

----------------------------------------------
<<results=hide,echo=false>>library(foreign)
library(Zelig)
library(memisc)
options(digits=4)
@

<<echo=false>>d <-
read.dta("~/project/abortion/data/data_transition_wide.dta")
@

...

----------------------------------------------

It can be compiled using "Sweave.sh foo.Rnw", but when I tried
"Sweave.sh -c
foo.Rnw", I got error message:
 "...Processing code chunks ...
1 : term hide
Error in data.frame(chunk = options$label, chunkprefix = chunkprefix,  :
 arguments imply differing number of rows: 0, 1"

I thought it might be an imcompatibiltiy problem between the cacheSweave and
the foreign packages, but the problem was still there when I tried to read
the data in using "read.table" function.

Any ideas? Many thanks.

Best,
Shige

	[[alternative HTML version deleted]]