Sweave and Xtable combining R analysis and LaTeX typesetting Lars - - PowerPoint PPT Presentation

sweave and xtable
SMART_READER_LITE
LIVE PREVIEW

Sweave and Xtable combining R analysis and LaTeX typesetting Lars - - PowerPoint PPT Presentation

Sweave and Xtable combining R analysis and LaTeX typesetting Lars Nilse Tbingen University separate R analysis and LaTeX typeseting *.R raw data 16 14 12 10 y 8 6 4 5 10 15 20 25 x analysed


slide-1
SLIDE 1

Sweave and Xtable

combining R analysis and LaTeX typesetting

Lars Nilse Tübingen University

slide-2
SLIDE 2

separate R analysis and LaTeX typeseting *.R

  • 5
10 15 20 25 4 6 8 10 12 14 16 x y

raw data analysed data (tables, plots)

slide-3
SLIDE 3

separate R analysis and LaTeX typeseting *.R

  • 5
10 15 20 25 4 6 8 10 12 14 16 x y

*.tex

raw data analysed data (tables, plots)

! ! ! ! ! ! ! 5 10 15 20 25 4 6 8 10 12 14 16 x y Figure 1: simple scatter plot Data Analysis The data of file data20110113.csv are listed in Tab. 1 and plotted in Fig. 1. The average x is 8.8571. V1 V2 1 1 6 2 2 7 3 3 3 4 6 12 5 9 14 6 16 14 7 25 16 Table 1: data from file

final report

slide-4
SLIDE 4

Sweave script *.Snw

raw data

! ! ! ! ! ! ! 5 10 15 20 25 4 6 8 10 12 14 16 x y Figure 1: simple scatter plot Data Analysis The data of file data20110113.csv are listed in Tab. 1 and plotted in Fig. 1. The average x is 8.8571. V1 V2 1 1 6 2 2 7 3 3 3 4 6 12 5 9 14 6 16 14 7 25 16 Table 1: data from file

final report

slide-5
SLIDE 5

*.Snw = *.tex with embedded *.R

slide-6
SLIDE 6

<< ... >> some R code @

slide-7
SLIDE 7

\Sexpr{ some R expression }

slide-8
SLIDE 8

generating tables using Xtable

slide-9
SLIDE 9

embedding plots

slide-10
SLIDE 10 ! ! ! ! ! ! !

5 10 15 20 25 4 6 8 10 12 14 16 x y

Figure 1: simple scatter plot

Data Analysis

The data of file data20110113.csv are listed in Tab. 1 and plotted in Fig. 1. The average x is 8.8571. V1 V2 1 1 6 2 2 7 3 3 3 4 6 12 5 9 14 6 16 14 7 25 16 Table 1: data from file

slide-11
SLIDE 11

snw2pdf.sh

slide-12
SLIDE 12

snw2pdf.sh

data20110113.csv template.Snw

slide-13
SLIDE 13

snw2pdf.sh

data20110113.csv template.Snw data20110113.Snw

slide-14
SLIDE 14

snw2pdf.sh

data20110113.csv template.Snw data20110113.Snw data20110113.tex

slide-15
SLIDE 15

snw2pdf.sh

data20110113.csv template.Snw data20110113.Snw data20110113.tex data20100113.pdf

slide-16
SLIDE 16

Sweave links

  • Sweave homepage

http://www.stat.uni-muenchen.de/~leisch/Sweave/

  • Sweave example

http://bit.ly/hkkyyb