]> git.lyx.org Git - lyx.git/blob - lib/examples/ja/knitr.lyx
Whitespace cosmetics
[lyx.git] / lib / examples / ja / knitr.lyx
1 #LyX 2.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 544
3 \begin_document
4 \begin_header
5 \save_transient_properties true
6 \origin /systemlyxdir/examples/ja/
7 \textclass article
8 \use_default_options true
9 \begin_modules
10 knitr
11 \end_modules
12 \maintain_unincluded_children false
13 \language japanese
14 \language_package default
15 \inputencoding auto
16 \fontencoding global
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
23 \font_sc false
24 \font_osf false
25 \font_sf_scale 100 100
26 \font_tt_scale 100 100
27 \use_microtype false
28 \use_dash_ligatures false
29 \graphics default
30 \default_output_format pdf
31 \output_sync 0
32 \bibtex_command default
33 \index_command default
34 \paperfontsize default
35 \spacing single
36 \use_hyperref false
37 \papersize default
38 \use_geometry true
39 \use_package amsmath 1
40 \use_package amssymb 1
41 \use_package cancel 0
42 \use_package esint 1
43 \use_package mathdots 1
44 \use_package mathtools 0
45 \use_package mhchem 1
46 \use_package stackrel 0
47 \use_package stmaryrd 0
48 \use_package undertilde 1
49 \cite_engine basic
50 \cite_engine_type default
51 \biblio_style plain
52 \use_bibtopic false
53 \use_indices false
54 \paperorientation portrait
55 \suppress_date false
56 \justification true
57 \use_refstyle 1
58 \index Index
59 \shortcut idx
60 \color #008000
61 \end_index
62 \leftmargin 2.5cm
63 \topmargin 2.5cm
64 \rightmargin 2.5cm
65 \bottommargin 2.5cm
66 \secnumdepth 3
67 \tocdepth 3
68 \paragraph_separation indent
69 \paragraph_indentation default
70 \is_math_indent 0
71 \math_numbering_side default
72 \quotes_style english
73 \papercolumns 1
74 \papersides 1
75 \paperpagestyle default
76 \tracking_changes false
77 \output_changes false
78 \html_math_output 0
79 \html_css_as_file 0
80 \html_be_strict false
81 \use_minted 0
82 \end_header
83
84 \begin_body
85
86 \begin_layout Title
87 \SpecialChar LyX
88 でknitrを使うには
89 \end_layout
90
91 \begin_layout Author
92 Yihui Xie
93 \begin_inset Foot
94 status collapsed
95
96 \begin_layout Plain Layout
97 アイオワ州立大学統計学部。電子メール: 
98 \begin_inset CommandInset href
99 LatexCommand href
100 name "xie@yihui.name"
101 target "xie@yihui.name"
102 type "mailto:"
103 literal "false"
104
105 \end_inset
106
107
108 \end_layout
109
110 \end_inset
111
112
113 \end_layout
114
115 \begin_layout Standard
116 R (
117 \begin_inset Flex URL
118 status collapsed
119
120 \begin_layout Plain Layout
121
122 http://www.r-project.org
123 \end_layout
124
125 \end_inset
126
127 )パッケージ
128 \series bold
129 knitr
130 \series default
131 は、Sweaveに似たツールですが、異なったデザインとより多くの機能を有しています。\SpecialChar LyX
132 は、Sweaveを第2.0.0版以降ネイティブにサポートしており、
133 \series bold
134 knitr
135 \series default
136 のサポートは第2.0.3版で追加されました。使用法は、基本的に
137 \family sans
138 Sweave
139 \family default
140 モジュールと同様です
141 \begin_inset Foot
142 status open
143
144 \begin_layout Plain Layout
145
146 \family sans
147 ヘルプ\SpecialChar menuseparator
148 用途別説明書
149 \family default
150 にある\SpecialChar LyX
151 /Sweave取扱説明書をお読みください。
152 \end_layout
153
154 \end_inset
155
156
157 \end_layout
158
159 \begin_layout Enumerate
160 新規\SpecialChar LyX
161 文書を開きます。
162 \end_layout
163
164 \begin_layout Enumerate
165
166 \family sans
167 文書\SpecialChar menuseparator
168 設定\SpecialChar menuseparator
169 モジュール
170 \family default
171
172 \family sans
173 Rnw (knitr)
174 \family default
175 モジュールを挿入します。
176 \end_layout
177
178 \begin_layout Enumerate
179 その後、文書中で
180 \family sans
181 挿入\SpecialChar menuseparator
182 \SpecialChar TeX
183 コード
184 \family default
185 メニューか
186 \family sans
187 コード組(chunk)
188 \family default
189 環境を使って、Rコードを挿入します。
190 \end_layout
191
192 \begin_layout Standard
193 パッケージのウェブサイト
194 \begin_inset Flex URL
195 status collapsed
196
197 \begin_layout Plain Layout
198
199 http://yihui.name/knitr
200 \end_layout
201
202 \end_inset
203
204 には、
205 \series bold
206 knitr
207 \series default
208 の完全な取扱説明書と多くのデモがあります。用例の多くには、\SpecialChar LyX
209 ソース文書へのリンクがあります。
210 \end_layout
211
212 \begin_layout Standard
213
214 \series bold
215 knitr
216 \series default
217 パッケージはR >= 2.14.1が必須であることに注意してください。もし古い版のRを使っているならば更新が必要です。以下に、簡単な例として一つのコード組を示します
218
219 \end_layout
220
221 \begin_layout Standard
222 \begin_inset ERT
223 status open
224
225 \begin_layout Plain Layout
226
227 <<show-off>>=
228 \end_layout
229
230 \begin_layout Plain Layout
231
232 rnorm(5)
233 \end_layout
234
235 \begin_layout Plain Layout
236
237 df=data.frame(y=rnorm(100), x=1:100)
238 \end_layout
239
240 \begin_layout Plain Layout
241
242 summary(lm(y~x, data=df))
243 \end_layout
244
245 \begin_layout Plain Layout
246
247 @
248 \end_layout
249
250 \end_inset
251
252
253 \end_layout
254
255 \begin_layout Standard
256 何か問題がある場合には、パッケージ作者に連絡してください。
257 \end_layout
258
259 \end_body
260 \end_document