1 #LyX 2.3 created this file. For more info see http://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/Modules/
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 1
46 \use_package stackrel 1
47 \use_package stmaryrd 1
48 \use_package undertilde 1
50 \cite_engine_type default
54 \paperorientation portrait
69 \paragraph_separation indent
70 \paragraph_indentation default
72 \math_numbering_side default
77 \paperpagestyle default
78 \tracking_changes false
88 Using knitr with \SpecialChar LyX
97 \begin_layout Plain Layout
98 Department of Statistics, Iowa State University.
100 \begin_inset CommandInset href
102 name "xie@yihui.name"
103 target "xie@yihui.name"
117 \begin_layout Standard
119 \begin_inset Flex URL
122 \begin_layout Plain Layout
124 http://www.r-project.org
133 is an alternative tool to Sweave based on a different design with more
136 has native support to Sweave since version 2.0.0, and the support to
140 was also added since 2.0.3.
141 The usage is basically the same as the
149 \begin_layout Plain Layout
150 read the \SpecialChar LyX
153 Help\SpecialChar menuseparator
162 \begin_layout Enumerate
163 Open a new \SpecialChar LyX
167 \begin_layout Enumerate
170 Document\SpecialChar menuseparator
171 Settings\SpecialChar menuseparator
174 and insert the module named
181 \begin_layout Enumerate
182 Then insert R code in the document with either
184 Insert\SpecialChar menuseparator
195 \begin_layout Standard
197 \begin_inset Flex URL
200 \begin_layout Plain Layout
202 http://yihui.name/knitr
207 has full documentation and demos of
211 ; many of the examples have links to the \SpecialChar LyX
215 \begin_layout Standard
216 Since \SpecialChar LyX
217 2.3, it is necessary to enable the use of
223 Preferences\SpecialChar menuseparator
224 File Handling\SpecialChar menuseparator
227 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
245 \begin_inset Flex Chunk
248 \begin_layout Plain Layout
250 \begin_inset Argument 1
253 \begin_layout Plain Layout
263 \begin_layout Plain Layout
268 \begin_layout Plain Layout
270 df=data.frame(y=rnorm(100), x=1:100)
273 \begin_layout Plain Layout
275 summary(lm(y~x, data=df))
283 \begin_layout Standard
284 Please contact the package author in case of any problems.