You are here:
Vanderbilt Biostatistics Wiki
>
Main Web
>
TWikiUsers
>
JoAnnAlvarez
>
SweaveWeaver
(14 Sep 2011,
JoAnnAlvarez
)
(raw view)
E
dit
A
ttach
-- Main.JoAnnAlvarez - 27 Aug 2010 ---+ Weaver! weaver can save results that take a long time to run, so that you can save time while you edit other R code chunks or latex code. Weaver knows when you edit code within something you've set to cache, and runs that part of code again when necessary. ---++ Install the weaver package on your linux machine: It's not on CRAN. You can download it from [[http://www.bioconductor.org/packages/1.9/bioc/html/weaver.html][bioconductor]]. If you're using linux, you want the source file. Save the .tar file in the directory with your other R packages. Make sure you already have the digest package installed. Go to the terminal and go to the directory. Run sudo R CMD INSTALL packagename.tar.gz Seth Falcon's [[http://www.bioconductor.org/packages/2.2/bioc/vignettes/weaver/inst/doc/weaver_howTo.pdf][ _How to use weaver_ ]] ---++ Start caching! Within your .nw file, for any R code chunks that you want to cache, use the cache=true Sweave option: <verbatim> <<cache=true>>= </verbatim> Load the weaver library. <verbatim> library(weaver) </verbatim> Then, when you Sweave the .nw file, use the driver = weaver() option of the Sweave function: <verbatim> Sweave( _filename.nw_, driver = weaver()) </verbatim> ---++ Notes * If you kill a Sweave() call when the weaver library is loaded, for the rest of your R session, R will not return any results to the terminal. You can fix this by running sink() after the kill. * Don't trust weaver to figure out the dependencies in your chunk. It can only detect changes in variables that are in a specific chunk %RED% when the change occurs in a previous chunk that has cache=true%ENDCOLOR%. * Don't include any printing or plotting within a chunk with cache=true.
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r3 - 14 Sep 2011,
JoAnnAlvarez
Main
Department Home Page
Biostatistics Graduate Program
Vanderbilt University Medical Center
Main Web
Main Web Home
Search
Recent Changes
Changes
Topic list
Biostatistics Webs
Archive
Main
Sandbox
System
Register
|
Log In
Copyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki?
Send feedback