トップ
新規
一覧
単語検索
最終更新
ヘルプ
ログイン
アールメカブ
hidden_R_Sweave
をテンプレートにして作成
開始行:
* Sweave On Emacs の覚書 [#z3b36e5f]
[[文芸的プログラミング Sweave>http://www.ci.tuwien.ac.at/...
* Stex ファイルの場合 [#k3931874]
以下は [[RjpWiki>http://www.okada.jp.org/RWiki/?Sweave%20...
\documentclass[a4paper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch }
\begin{document}
\maketitle
この例では \texttt{kruskal.test} のヘルプページ中の例の
一部を \LaTeX{} 文章に埋め込む:
\begin{Scode}
data(airquality)
library(ctest)
kruskal.test(Ozone ~ Month , data = airquality)
\end{Scode}
これはオゾンの分布の位置パラメータが月毎に有意に変動する
ことを示す。次に、データのボックスプロットを含める:
\begin{center}
\begin{Scode}{fig=TRUE,echo = FALSE}
boxplot(Ozone ~ Month , data = airquality)
\end{Scode}
\end{center}
\end{document}
と言うファイルに Sweave()関数を適用すれば,tex ファイルが...
* Rnw ファイルの場合 [#j451ccdd]
+ ファイルの拡張子は .Rnw
+ 処理するためには R が走っていないといけない.だが Rnw ...
+ R のスクリプトを開いて,M-x R とする.
+ .Rnw ファイルを開いて,以下のいずれかのコマンドを実行す...
''&color(red){ただし,M-n l (/usr/texmf-texlive/ の /usr/...
;; M-n s to Sweave the file, then
;; M-n l to run latex on the results of Sweave, then
;; M-n p to make and display a postscript file , or
;; M-n P to make and display a PDF version.
https://svn.r-project.org/ESS/trunk/lisp/ess-swv.el
にあるとおり,
; With these functions and key bindings all I need to do ...
;; file and, assuming R is running, I press:
ところが, pdf が作成されない.以下の環境変数を明示的に設...
しかし,実は,これは今ではエラーを起こす処理であった.
http://tutimura.ath.cx/ptetex/?%C2%BF%BD%C5TEXMF%A5%C4%A5...
export TETEX_PATH=/usr/local/teTeX
export TEXMF=$TETEX_PATH/share/texmf
export TETEX_BIN_PATH=$TETEX_PATH/bin
> 少し昔を知る人向けの注意 昔は TEXMF を環境変数で指定す...
<
http://tutimura.ath.cx/ptetex/?%C2%BE%A4%CETeX%B4%C4%B6%A...
>ptetex3 は、OS ディストリビューション付属の TeX パッケー...
>
すると,今度は pdf が作成されるが,文字化け.エラーを見ると
LaTeX Warning: You have requested package `/usr/local/li...
,
but the package provides `Sweave'.
(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))
(/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/...
No file fancyvrb.cfg.
) (/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/base/t1enc.def))
(/usr/share/texmf-texlive/tex/latex/ae/ae.sty
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/base/t1enc.def)
(/usr/share/texmf-texlive/tex/latex/ae/t1aer.fd))))
No file sweave.aux.
(/usr/share/texmf-texlive/tex/latex/ae/t1aett.fd)
(see the transcript file for additional information)
Output written on sweave.dvi (1 page, 1516 bytes).
Transcript written on sweave.log.
と, TexLive が使われている.TexLive が使われると文字化...
/usr/share/emacs/site-lisp/ess/ess-swv.el で,コンパイル...
http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?LaTeX%20%E3%...
の説明を参考にして,強引に Sweave.sty の頭に
\ProvidesPackage{/usr/local/lib/R/share/texmf/Sweave}{}
とすれば,一応エラーは消えるが,その下で requiredPackages...
sudo cp -p /home/ishida/progSource/Tex/Sweave.sty /usr/lo...
結局,元の Sweave.styに戻しておいた.
ちなみにコマンドライン上で実行してみると,
ishida@dell530s:~/research/statistics/myRcode$ platex sw...
This is pTeX, Version 3.141592-p3.1.10 (euc) (Web2C 7.5.4)
(./sweave.tex
pLaTeX2e <2006/11/10>+0 (based on LaTeX2e <2003/12/01> p...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/articl...
Document Class: article 2004/02/16 v1.4f Standard LaTeX ...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/size10...
(/usr/local/lib/R/share/texmf/Sweave.sty
LaTeX Warning: You have requested package `/usr/local/li...
,
but the package provides `Sweave'.
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/ifthen...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/gr...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/ke...
(/usr/local/teTeX/share/texmf/tex/latex/graphics/dvipdfm...
s.sty (/usr/local/teTeX/share/texmf-dist/tex/latex/graph...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/gr...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/dv...
(/usr/local/teTeX/share/texmf-dist/tex/latex/fancyvrb/fa...
Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/...
No file fancyvrb.cfg.
) (/usr/local/teTeX/share/texmf-dist/tex/latex/upquote/u...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/textco...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/ts1enc...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/fonten...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/t1enc....
Running mktextfm ecrm1000
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; m...
input ecrm1000
This is METAFONT, Version 2.71828 (Web2C 7.5.4)
kpathsea: Running mktexmf ecrm1000
mktexmf: /var/tmp/texfonts/source/jknappen/ec/ecrm1000.m...
となって,正常に呼び出されている.でも文字化けするのは変...
終了行:
* Sweave On Emacs の覚書 [#z3b36e5f]
[[文芸的プログラミング Sweave>http://www.ci.tuwien.ac.at/...
* Stex ファイルの場合 [#k3931874]
以下は [[RjpWiki>http://www.okada.jp.org/RWiki/?Sweave%20...
\documentclass[a4paper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch }
\begin{document}
\maketitle
この例では \texttt{kruskal.test} のヘルプページ中の例の
一部を \LaTeX{} 文章に埋め込む:
\begin{Scode}
data(airquality)
library(ctest)
kruskal.test(Ozone ~ Month , data = airquality)
\end{Scode}
これはオゾンの分布の位置パラメータが月毎に有意に変動する
ことを示す。次に、データのボックスプロットを含める:
\begin{center}
\begin{Scode}{fig=TRUE,echo = FALSE}
boxplot(Ozone ~ Month , data = airquality)
\end{Scode}
\end{center}
\end{document}
と言うファイルに Sweave()関数を適用すれば,tex ファイルが...
* Rnw ファイルの場合 [#j451ccdd]
+ ファイルの拡張子は .Rnw
+ 処理するためには R が走っていないといけない.だが Rnw ...
+ R のスクリプトを開いて,M-x R とする.
+ .Rnw ファイルを開いて,以下のいずれかのコマンドを実行す...
''&color(red){ただし,M-n l (/usr/texmf-texlive/ の /usr/...
;; M-n s to Sweave the file, then
;; M-n l to run latex on the results of Sweave, then
;; M-n p to make and display a postscript file , or
;; M-n P to make and display a PDF version.
https://svn.r-project.org/ESS/trunk/lisp/ess-swv.el
にあるとおり,
; With these functions and key bindings all I need to do ...
;; file and, assuming R is running, I press:
ところが, pdf が作成されない.以下の環境変数を明示的に設...
しかし,実は,これは今ではエラーを起こす処理であった.
http://tutimura.ath.cx/ptetex/?%C2%BF%BD%C5TEXMF%A5%C4%A5...
export TETEX_PATH=/usr/local/teTeX
export TEXMF=$TETEX_PATH/share/texmf
export TETEX_BIN_PATH=$TETEX_PATH/bin
> 少し昔を知る人向けの注意 昔は TEXMF を環境変数で指定す...
<
http://tutimura.ath.cx/ptetex/?%C2%BE%A4%CETeX%B4%C4%B6%A...
>ptetex3 は、OS ディストリビューション付属の TeX パッケー...
>
すると,今度は pdf が作成されるが,文字化け.エラーを見ると
LaTeX Warning: You have requested package `/usr/local/li...
,
but the package provides `Sweave'.
(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))
(/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/...
No file fancyvrb.cfg.
) (/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/base/t1enc.def))
(/usr/share/texmf-texlive/tex/latex/ae/ae.sty
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/base/t1enc.def)
(/usr/share/texmf-texlive/tex/latex/ae/t1aer.fd))))
No file sweave.aux.
(/usr/share/texmf-texlive/tex/latex/ae/t1aett.fd)
(see the transcript file for additional information)
Output written on sweave.dvi (1 page, 1516 bytes).
Transcript written on sweave.log.
と, TexLive が使われている.TexLive が使われると文字化...
/usr/share/emacs/site-lisp/ess/ess-swv.el で,コンパイル...
http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?LaTeX%20%E3%...
の説明を参考にして,強引に Sweave.sty の頭に
\ProvidesPackage{/usr/local/lib/R/share/texmf/Sweave}{}
とすれば,一応エラーは消えるが,その下で requiredPackages...
sudo cp -p /home/ishida/progSource/Tex/Sweave.sty /usr/lo...
結局,元の Sweave.styに戻しておいた.
ちなみにコマンドライン上で実行してみると,
ishida@dell530s:~/research/statistics/myRcode$ platex sw...
This is pTeX, Version 3.141592-p3.1.10 (euc) (Web2C 7.5.4)
(./sweave.tex
pLaTeX2e <2006/11/10>+0 (based on LaTeX2e <2003/12/01> p...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/articl...
Document Class: article 2004/02/16 v1.4f Standard LaTeX ...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/size10...
(/usr/local/lib/R/share/texmf/Sweave.sty
LaTeX Warning: You have requested package `/usr/local/li...
,
but the package provides `Sweave'.
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/ifthen...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/gr...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/ke...
(/usr/local/teTeX/share/texmf/tex/latex/graphics/dvipdfm...
s.sty (/usr/local/teTeX/share/texmf-dist/tex/latex/graph...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/gr...
(/usr/local/teTeX/share/texmf-dist/tex/latex/graphics/dv...
(/usr/local/teTeX/share/texmf-dist/tex/latex/fancyvrb/fa...
Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/...
No file fancyvrb.cfg.
) (/usr/local/teTeX/share/texmf-dist/tex/latex/upquote/u...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/textco...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/ts1enc...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/fonten...
(/usr/local/teTeX/share/texmf-dist/tex/latex/base/t1enc....
Running mktextfm ecrm1000
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; m...
input ecrm1000
This is METAFONT, Version 2.71828 (Web2C 7.5.4)
kpathsea: Running mktexmf ecrm1000
mktexmf: /var/tmp/texfonts/source/jknappen/ec/ecrm1000.m...
となって,正常に呼び出されている.でも文字化けするのは変...
ページ名: