Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
This feature request brought much sanity to me on the file management.
In the past, my brain was a mess but now things are clearer: all input
(data, child documents) paths are relative to the Rnw file, and all
output files (tex files, figures, cache) are relative to the current
working directory. In your case, you can create a directory to store
the output, e.g.
./input/
- main.Rnw (contains knit_child('child.Rnw') and read.csv('data.csv'))
- child.Rnw
- data.csv
./output/
You can setwd() to ./output/ first, then call knit('../main.Rnw'), and
you get output like this:
./output/
- cache/
- figure/
- main.tex
- child.tex
For child.Rnw, you can call set_parent('main.Rnw') so it borrows
preamble from main.Rnw; not set_parent() is aware of whether the
current child document is compiled as a child document or a standalone
document, so you can use it freely.
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
For the second point, that is certainly possible, as long as these
chunks are in the preamble as well. I can find them out and evaluate
them in set_parent(). I will do it later:
https://github.com/yihui/knitr/issues/139
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
I plan to do a new release to CRAN this weekend, so please let me know
if there are any problems (it worked when I tested it, though).
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
Now I have one last problem, I don't know if it's something I'm doing wrong.
knit_hooks$set(crop=hook_pdfcrop) isn't being recognized in my child documents, when running from parent. It works when running standalone, though. That's my only hook by the way.
Helder Correia
http://heldercorreia.com/
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
Thanks, Yihui!
Helder Correia