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 \default_output_format default
30 \bibtex_command default
31 \index_command default
32 \paperfontsize default
37 \use_package amsmath 1
38 \use_package amssymb 1
41 \use_package mathdots 1
42 \use_package mathtools 0
44 \use_package stackrel 0
45 \use_package stmaryrd 0
46 \use_package undertilde 1
48 \cite_engine_type default
52 \paperorientation portrait
66 \paragraph_separation indent
67 \paragraph_indentation default
68 \quotes_language english
71 \paperpagestyle default
72 \tracking_changes true
77 \author 2047637253 "Guillaume Munch"
83 Using knitr with \SpecialChar LyX
92 \begin_layout Plain Layout
93 Department of Statistics, Iowa State University.
95 \begin_inset CommandInset href
98 target "xie@yihui.name"
111 \begin_layout Standard
113 \begin_inset Flex URL
116 \begin_layout Plain Layout
118 http://www.r-project.org
127 is an alternative tool to Sweave based on a different design with more
130 has native support to Sweave since version 2.0.0, and the support to
134 was also added since 2.0.3.
135 The usage is basically the same as the
143 \begin_layout Plain Layout
144 read the \SpecialChar LyX
147 Help\SpecialChar menuseparator
156 \begin_layout Enumerate
157 Open a new \SpecialChar LyX
161 \begin_layout Enumerate
164 Document\SpecialChar menuseparator
165 Settings\SpecialChar menuseparator
168 and insert the module named
175 \begin_layout Enumerate
176 Then insert R code in the document with either
178 Insert\SpecialChar menuseparator
189 \begin_layout Standard
191 \begin_inset Flex URL
194 \begin_layout Plain Layout
196 http://yihui.name/knitr
201 has full documentation and demos of
205 ; many of the examples have links to the \SpecialChar LyX
207 \change_inserted 2047637253 1483899260
211 \begin_layout Standard
213 \change_inserted 2047637253 1483899275
214 Since \SpecialChar LyX
215 2.3, it is necessary to enable the use of
221 Preferences\SpecialChar menuseparator
222 File Handling\SpecialChar menuseparator
225 in order to compile with
234 \begin_layout Standard
239 package requires R >= 2.14.1, so you need to update R if you are using an
241 Here we show one chunk as a simple example:
244 \begin_layout Standard
246 \change_inserted 2047637253 1483899195
247 \begin_inset Flex Chunk
250 \begin_layout Plain Layout
252 \change_inserted 2047637253 1483899204
254 \begin_inset Argument 1
257 \begin_layout Plain Layout
259 \change_inserted 2047637253 1483899200
270 \begin_layout Plain Layout
272 \change_inserted 2047637253 1483899204
277 \begin_layout Plain Layout
279 \change_inserted 2047637253 1483899204
281 df=data.frame(y=rnorm(100), x=1:100)
284 \begin_layout Plain Layout
286 \change_inserted 2047637253 1483899204
288 summary(lm(y~x, data=df))
300 \begin_layout Standard
302 \change_deleted 2047637253 1483899208
306 \begin_layout Plain Layout
311 \begin_layout Plain Layout
316 \begin_layout Plain Layout
318 df=data.frame(y=rnorm(100), x=1:100)
321 \begin_layout Plain Layout
323 summary(lm(y~x, data=df))
326 \begin_layout Plain Layout
338 \begin_layout Standard
339 Please contact the package author in case of any problems.