1 #LyX 2.3 created this file. For more info see http://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/
8 \use_default_options true
12 \maintain_unincluded_children false
14 \language_package default
17 \font_roman "palatino" "default"
18 \font_sans "lmss" "default"
19 \font_typewriter "lmtt" "default"
20 \font_math "auto" "auto"
21 \font_default_family default
22 \use_non_tex_fonts false
25 \font_sf_scale 100 100
26 \font_tt_scale 100 100
28 \use_dash_ligatures false
30 \default_output_format default
32 \bibtex_command default
33 \index_command default
34 \paperfontsize default
39 \use_package amsmath 1
40 \use_package amssymb 1
43 \use_package mathdots 1
44 \use_package mathtools 0
46 \use_package stackrel 0
47 \use_package stmaryrd 0
48 \use_package undertilde 1
50 \cite_engine_type default
54 \paperorientation portrait
68 \paragraph_separation indent
69 \paragraph_indentation default
74 \paperpagestyle default
75 \tracking_changes true
80 \author 2047637253 "Guillaume Munch"
86 Using knitr with \SpecialChar LyX
95 \begin_layout Plain Layout
96 Department of Statistics, Iowa State University.
98 \begin_inset CommandInset href
100 name "xie@yihui.name"
101 target "xie@yihui.name"
115 \begin_layout Standard
117 \begin_inset Flex URL
120 \begin_layout Plain Layout
122 http://www.r-project.org
131 is an alternative tool to Sweave based on a different design with more
134 has native support to Sweave since version 2.0.0, and the support to
138 was also added since 2.0.3.
139 The usage is basically the same as the
147 \begin_layout Plain Layout
148 read the \SpecialChar LyX
151 Help\SpecialChar menuseparator
160 \begin_layout Enumerate
161 Open a new \SpecialChar LyX
165 \begin_layout Enumerate
168 Document\SpecialChar menuseparator
169 Settings\SpecialChar menuseparator
172 and insert the module named
179 \begin_layout Enumerate
180 Then insert R code in the document with either
182 Insert\SpecialChar menuseparator
193 \begin_layout Standard
195 \begin_inset Flex URL
198 \begin_layout Plain Layout
200 http://yihui.name/knitr
205 has full documentation and demos of
209 ; many of the examples have links to the \SpecialChar LyX
211 \change_inserted 2047637253 1483899260
215 \begin_layout Standard
217 \change_inserted 2047637253 1483899275
218 Since \SpecialChar LyX
219 2.3, it is necessary to enable the use of
225 Preferences\SpecialChar menuseparator
226 File Handling\SpecialChar menuseparator
229 in order to compile with
238 \begin_layout Standard
243 package requires R >= 2.14.1, so you need to update R if you are using an
245 Here we show one chunk as a simple example:
248 \begin_layout Standard
250 \change_inserted 2047637253 1483899195
251 \begin_inset Flex Chunk
254 \begin_layout Plain Layout
256 \change_inserted 2047637253 1483899204
258 \begin_inset Argument 1
261 \begin_layout Plain Layout
263 \change_inserted 2047637253 1483899200
274 \begin_layout Plain Layout
276 \change_inserted 2047637253 1483899204
281 \begin_layout Plain Layout
283 \change_inserted 2047637253 1483899204
285 df=data.frame(y=rnorm(100), x=1:100)
288 \begin_layout Plain Layout
290 \change_inserted 2047637253 1483899204
292 summary(lm(y~x, data=df))
304 \begin_layout Standard
306 \change_deleted 2047637253 1483899208
310 \begin_layout Plain Layout
315 \begin_layout Plain Layout
320 \begin_layout Plain Layout
322 df=data.frame(y=rnorm(100), x=1:100)
325 \begin_layout Plain Layout
327 summary(lm(y~x, data=df))
330 \begin_layout Plain Layout
342 \begin_layout Standard
343 Please contact the package author in case of any problems.