# # # # # # # # # # # # # # # # # # #
# R to LaTeX, Main file generation #
# Examples #
# r2lMainFile #
# # # # # # # # # # # # # # # # #
### Creates a Sweave file
text <- "
\\maketitle
\\tableofcontents
<<>>=
data(examCheating)
@
\\section{Univariate analysis}
<<>>=
r2lu(examCheating$CheatScore,fileOut='ExamCheat-univ1.tex')
@
\\input{ExamCheat-univ1.tex}
\\section{Bivariate analysis}
<<>>=
#r2lb(examCheating$CheatScore~examCheating$Sexe,fileOut='ExamCheat-biv1.tex')
@
\\input{ExamCheat-biv1.tex}
"
if(!file.exists("tmp/sweave",recursive=TRUE)){dir.create("tmp/sweave",recursive=TRUE)}else{}
setwd("tmp/sweave")
r2lMainFile(fileOut="main.Rnw",text=text,sweave=TRUE)
Sweave("main.Rnw")
setwd("../..")
Run the code above in your browser using DataLab