1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
6 \use_default_options true
10 \maintain_unincluded_children false
12 \language_package default
17 \font_typewriter default
18 \font_default_family default
19 \use_non_tex_fonts false
26 \default_output_format default
28 \bibtex_command default
29 \index_command default
30 \paperfontsize default
42 \paperorientation portrait
51 \paragraph_separation skip
53 \quotes_language english
56 \paperpagestyle default
57 \tracking_changes false
75 \begin_layout Plain Layout
77 \begin_inset Quotes eld
81 \begin_inset Quotes erd
92 \begin_layout Standard
93 A simple example that will run in any S engine: The integers from 1 to 10
114 @ % the above is just to ensure that 2 code chunks can follow each other
117 \begin_layout Standard
118 We can also emulate a simple calculator:
126 <<echo=TRUE,print=TRUE>>=
145 \begin_layout Standard
146 Now we look at Gaussian data:
170 print(t1 <- t.test(x))
177 \begin_layout Standard
178 Note that we can easily integrate some numbers into standard text: The third
184 \begin_inset Flex S/R expression
187 \begin_layout Plain Layout
195 \begin_inset Formula $p$
198 -value of the test is
199 \begin_inset Flex S/R expression
202 \begin_layout Plain Layout
204 format.pval(t1$p.value)
212 \begin_layout Standard
222 Now we look at a summary of the famous iris dataset, and we want to see
223 the commands in the code chunks:
226 \begin_layout Standard
227 \begin_inset Flex Sweave Options
230 \begin_layout Plain Layout
232 echo=true,keep.source=true
260 \begin_layout Standard
261 \begin_inset Float figure
279 \begin_inset Newline newline
283 \begin_inset Newline newline
287 \begin_inset Newline newline
293 \begin_layout Plain Layout
296 \begin_layout Plain Layout
297 Pairs plot of the iris data.
310 \begin_layout Standard
311 \begin_inset Float figure
321 \begin_inset Newline newline
324 boxplot(Sepal.Length~Species,data=iris)
325 \begin_inset Newline newline
331 \begin_layout Plain Layout
334 \begin_layout Plain Layout
335 Boxplot of sepal length grouped by species.
353 function.that.comes.only.with.Splus(x)
360 \begin_layout Standard
361 \begin_inset Float figure
370 \begin_inset Newline newline
373 boxplot(Sepal.Length~Species,data=iris)
374 \begin_inset Newline newline
380 \begin_layout Plain Layout
383 \begin_layout Plain Layout
384 Boxplot of sepal length grouped by species