Hi Karen,

Once you've run your .Rnw file once, and (say) assigned the output of  
a lm(y ~ x) to m1, you can add your summary at the beginning of  
your .Rnw file and output quantities such as the intercept (to be  
produced "later") using $\Sexpr{round(as.numeric(coef(m1)[1]), 3)}$  
(it's a good idea to have the $$ because otherwise minus signs will  
print as hyphens). This is the case that the object m1 will still be  
available at the beginning of the next run. This is not perfect, b/c  
if later, during a different R session, you want to run the Rnw file  
through again, you'll have to remove the \Sexpr{} in your summary  
until the second run. So you can keep two versions of your Rnw file, a  
short one for the first run, and a longer one for the second.

On Apr 15, 2009, at 1:47 PM, Karen_Byron@bd.com wrote:

>
>   I'm learning to use R/Sweave/LaTeK to write my stat reports.  Is  
> there a way
>   to  have  an executive summary in the beginning while still having  
> the
>   analysis  code  embedded?   For example, a study has three  
> independent
>   objectives so I want my report to have three sections.  Ideally  
> the code
>   chunk  that answers the first objective would be embedded in the  
> first
>   section and so on.  However I want a table that summarizes the  
> results from
>   all three objectives at the beginning of the report.  Is there a  
> way to
>   generate a summary after the three sections but tell LaTeK to  
> publish it
>   first?  Possibly by rearranging the sections/pages?
>   Currently I'm doing all the coding in a big block up front but  
> that waste
>   much of the advantage of weaving to me.

HTH,
MK
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
        McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/



	[[alternative HTML version deleted]]


