60 likes | 210 Views
Reproducible Research. Lisa Pappas 10/21/10 SDBC meeting. Goals. Be able to reproduce your own results Allow others to reproduce your results Time turns each one of us into another person, and by making eort to communicate with strangers, we help ourselves to communicate
E N D
Reproducible Research Lisa Pappas 10/21/10 SDBC meeting
Goals • Be able to reproduce your own results • Allow others to reproduce your results • Time turns each one of us into another person, • and by making eort to communicate with • strangers, we help ourselves to communicate • with our future selves. (Schwab and Claerbout) • Reproduce an entire report, manuscript, dissertation, book • with a single system command when changes occur in: • operating system, stat software, graphics engines, source • data, derived variables, analysis, interpretation • Save time • Provide the ultimate documentation of work done for a • paper Frank E Harrell Jr
Prior to running Sweave: • Install MiKTeX: it is free and is necessary for creating PDF files from the TeX files that Sweave generates. http://miktex.org/ • Consider using the trial version or purchasing WinEdt 6.0. There are built in functions for generating PDF files . http://www.winedt.com/ • If you are using Windows, have R installed in a path with no spaces (C:\R vs. the default C:\Program files\R) –OR- make sure you include \usepackage{Sweave} in your program and have the file Sweave.sty in your working directory. Sweave.sty can be found ‘$R_HOME\share\texmf\tex\latex’ • Have packages ‘tools’ and ‘Hmisc’ installed in R.
Diagram of process http://biostat.mc.vanderbilt.edu/wiki/pub/Main/TheresaScott/ReproducibleResearch.TAScott.handout.pdf
Running the example Sweave file in R: • >Sweave(‘example.Rnw’) • >texi2dvi(‘example.tex’, pdf=TRUE)
Good Sweave references: • Sweave homepage: http://www.statistik.lmu.de/~leisch/Sweave/ • Reproducible Research with R, LaTeX & Sweave: http://biostat.mc.vanderbilt.edu/wiki/pub/Main/TheresaScott/ReproducibleResearch.TAScott.handout.pdf • Additional links: http://gettinggeneticsdone.blogspot.com/2010/05/using-r-latex-and-sweave-for.html