# # # # # # # # # # # # # # # # # # #
# R to HTML, Bivariate Analyses #
# Artificial examples #
# Single variable #
# # # # # # # # # # # # # # # # #
### 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
if(!file.exists("tmp/r2hbExample",recursive=TRUE)){dir.create("tmp/r2hbExample",recursive=TRUE)}else{}
setwd("tmp/r2hbExample")
### Execute r2hb
r2hb(V1~V2,fileOut="first.html",textBefore="<H2>Variables V1, V2, V3</H2>",graphName="Gr1",type="png")
r2hb(V2~V1,fileOut="second.html",graphName="Gr2",type="png")
r2hb(V3~V1,fileOut="third.html",textBefore="This is V3 vs. V1",graphDir="P",graphName="Gr3",type="png",displayStyle=2)
r2hMainFile(text="
<LU>
<LI><A HREF='first.html'>First example</A></LI>
<LI><A HREF='second.html'>Second example</A></LI>
<LI><A HREF='third.html'>Third example</A></LI>
</LU>
")
setwd("..")
Run the code above in your browser using DataLab