If I load data(mtcars)
it comes with a very neat codebook that I can call using ?mtcars
.
I'm interested to document my data in the same way and, furthermore, save that neat codebook as a pdf.
Is it possible to save the 'content' of ?mtcars
and how is it created?
Thanks, Eric
P.S. I did read this thread.
update 2012-05-14 00:39:59 PDT
I am looking for a solution using only R; unfortunately I cannot rely on other software (e.g. Tex)
update 2012-05-14 09:49:05 PDT
Thank you very much everyone for the many answers.
Reading these answers I realized that I should have made my priorities much clearer. Therefore, here is a list of my priorities in regard to this question.
- R, I am looking for a solution that is based exclusively on R.
- Reproducibility, that the codebook can be part of a automated script.
- Readability, the text should be easy to read.
- Searchability, a file that can be open with any standard software and searched (this is why I thought pdf would be a good solution, but this is overruled by 1 through 3).
I am currently labeling my variables using label()
from the Hmisc package and might end up writing a .txt codebook using Label()
from the same package.