### Create some data
V1 <- factor(LETTERS[floor(runif(50,1,4))])
V2 <- rnorm(50,1,1)<0
V3 <- ordered(LETTERS[floor(runif(50,1,4))])
### Create a directory for the output
r2lhOutDir <- paste(tempdir(),"rtlbExample",sep="/")
if(!file.exists(r2lhOutDir)){dir.create(r2lhOutDir)}
setwd(r2lhOutDir)
### Execute rtlb
rtlb(V1~V2,fileOut="first.tex",textBefore="\\section{Variables V1, V2, V3}",graphName="Gr1",type="postscript")
rtlb(V2~V1,fileOut="second.tex",graphName="Gr2",type="postscript")
rtlb(V3~V1,fileOut="third.tex",textBefore="This is V3 vs. V1",graphDir="P",graphName="Gr3",type="postscript",displayStyle=2)
rtlMainFile(text="\\input{first.tex}
\\input{second.tex}
\\input{third.tex}")
setwd("..")
Run the code above in your browser using DataLab