1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
6 \use_default_options true
10 \maintain_unincluded_children false
17 \font_default_family default
18 \use_non_tex_fonts false
25 \default_output_format default
27 \bibtex_command default
28 \index_command default
29 \paperfontsize default
41 \paperorientation portrait
50 \paragraph_separation skip
52 \quotes_language english
55 \paperpagestyle default
56 \tracking_changes false
73 \begin_layout Plain Layout
75 \begin_inset Quotes eld
79 \begin_inset Quotes erd
90 \begin_layout Standard
91 A simple example that will run in any S engine: The integers from 1 to 10
112 @ % the above is just to ensure that 2 code chunks can follow each other
115 \begin_layout Standard
116 We can also emulate a simple calculator:
120 <<echo=TRUE,print=TRUE>>=
139 \begin_layout Standard
140 Now we look at Gaussian data:
160 print(t1 <- t.test(x))
167 \begin_layout Standard
168 Note that we can easily integrate some numbers into standard text: The third
174 \begin_inset Flex S/R expression
177 \begin_layout Plain Layout
185 \begin_inset Formula $p$
188 -value of the test is
189 \begin_inset Flex S/R expression
192 \begin_layout Plain Layout
194 format.pval(t1$p.value)
202 \begin_layout Standard
212 Now we look at a summary of the famous iris dataset, and we want to see
213 the commands in the code chunks:
216 \begin_layout Standard
217 \begin_inset Flex Sweave Options
220 \begin_layout Plain Layout
222 echo=true,keep.source=true
250 \begin_layout Standard
251 \begin_inset Float figure
257 \begin_layout Plain Layout
263 \begin_layout Plain Layout
268 \begin_layout Plain Layout
273 \begin_layout Plain Layout
278 \begin_layout Plain Layout
288 \begin_layout Plain Layout
291 \begin_layout Plain Layout
292 Pairs plot of the iris data.
305 \begin_layout Standard
306 \begin_inset Float figure
312 \begin_layout Plain Layout
318 \begin_layout Plain Layout
323 \begin_layout Plain Layout
325 boxplot(Sepal.Length~Species,data=iris)
328 \begin_layout Plain Layout
338 \begin_layout Plain Layout
341 \begin_layout Plain Layout
342 Boxplot of sepal length grouped by species.
360 function.that.comes.only.with.Splus(x)
367 \begin_layout Standard
368 \begin_inset Float figure
373 \begin_layout Plain Layout
379 \begin_layout Plain Layout
384 \begin_layout Plain Layout
386 boxplot(Sepal.Length~Species,data=iris)
389 \begin_layout Plain Layout
399 \begin_layout Plain Layout
402 \begin_layout Plain Layout
403 Boxplot of sepal length grouped by species